Just to be clear, that doesn't work if the original expression doesn't start with ^.
>perl -le"print 'abc' !~ /b/ ?1:0" 0 >perl -le"print 'abc' =~ /^(?!b)/ ?1:0" 1 >perl -le"print 'abc' =~ /(?!b)/ ?1:0" 1
That may not be an issue in this case.
In reply to Re^2: regex negation without !~
by ikegami
in thread regex negation without !~
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |