in reply to regular expressions with !
... if(not $test_string =~ /$regex/) { ... } ...
It's basically a question of operator precedence.
To make your intentions clearer, you should probably use the '!~' operator:
... if($test_string !~ /$regex/) { ... } ...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: regular expressions with !
by ikegami (Patriarch) on Sep 14, 2006 at 14:27 UTC | |
Re^2: regular expressions with !
by Tomte (Priest) on Sep 14, 2006 at 14:37 UTC |