You're mistaking character class negation for "doesn't match".
[^a-z] means "Match a single character that is not a through z." But it doesn't mean "target may not contain a-z." If that's your intention, you might accomplish it like this:
if( $plat !~ m/[a-z]/ ) { ....Or...
if( $plat =~ m/^[^a-z]*$/ ) { ...The former simply says "If target doesn't match a-z." The second says, "If target matches a string that contains any amount of anything except for a-z."
Dave
In reply to Re: regex hell
by davido
in thread regex hell
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |