in reply to regex hell

I'm pretty confused too. I have very little idea what you are trying to achieve. However if you modify the code below and test strings to demonstrate your problem, maybe we can help you further?

Note that the regex you specify matches any string in which there is at least one character which is not a lower case alpha character.

use strict; use warnings; my $change = 1; while (my $plat = <DATA>) { chomp $plat; print "$plat: "; if ($plat =~ /[^a-z]/) { print "Nothing here."; $change = 0; } if ($change) { print "Platform: $plat*"; } print "\n"; } __DATA__ OS/x os/x OS/X win WIN Win

Prints:

OS/x: Nothing here. os/x: Nothing here. OS/X: Nothing here. win: WIN: Nothing here. Win: Nothing here.

DWIM is Perl's answer to Gödel