If the goal here is to do things with strings which do not match a pattern, don't try to use a negative look-ahead -- just negate the test:
my @strings = ( "ERROR blah license will expire", "ERROR blah something else", "ERROR blah Error processing Cancel Execution", ); foreach (@strings) { if (!($_ =~ /^ERROR.+?(Error processing Cancel Execution|license w +ill expire)$/)) { print "Do something with '$_'\n"; } }
In reply to Re: Regex: negative look ahead
by halfcountplus
in thread Regex: negative look ahead
by fcaw1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |