perlquestion
kgimpel
I am passing a positive regex as a string argument to another function, and I'd only like to match on lines that don't contain "bar."<p>
IE:<p>
INPUT looks like this:<br>
foo<br>
"bar" blah<br>
"test" blah<br>
"test2"
<p>
MATCHES should be:<br>
foo<br>
"test" blah<br>
"test2"
<p>
So, I effectively want to do this <br><code>$_ !~ /bar/</code><br> but I cannot change the logic to do it.<p>
I've tried <br><code>/.*?(?!bat)/</code><br> but I think the line taken as a whole, <br><code>^.*bar.*$</code><br> satifies n-characters not followed by "bar," so we get a positive match. Can anyone suggest pattern for this? <p> Thanks in advance.