kgimpel has asked for the wisdom of the Perl Monks concerning the following question:
IE:
INPUT looks like this:
foo
"bar" blah
"test" blah
"test2"
MATCHES should be:
foo
"test" blah
"test2"
So, I effectively want to do this
$_ !~ /bar/
but I cannot change the logic to do it.
I've tried
/.*?(?!bat)/
but I think the line taken as a whole,
^.*bar.*$
satifies n-characters not followed by "bar," so we get a positive match. Can anyone suggest pattern for this?
Thanks in advance.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: positive regex for inverted match
by eyepopslikeamosquito (Archbishop) on Feb 26, 2004 at 07:12 UTC | |
Re: positive regex for inverted match
by I0 (Priest) on Feb 26, 2004 at 06:32 UTC | |
Re: positive regex for inverted match
by Zaxo (Archbishop) on Feb 26, 2004 at 06:20 UTC | |
Re: positive regex for inverted match
by BrowserUk (Patriarch) on Feb 26, 2004 at 08:01 UTC | |
by Crian (Curate) on Feb 26, 2004 at 09:11 UTC | |
Re: positive regex for inverted match
by kvale (Monsignor) on Feb 26, 2004 at 06:33 UTC | |
by tye (Sage) on Feb 26, 2004 at 07:55 UTC | |
Re: positive regex for inverted match
by ysth (Canon) on Feb 26, 2004 at 08:01 UTC | |
Re: positive regex for inverted match
by arden (Curate) on Feb 26, 2004 at 06:30 UTC | |
by hossman (Prior) on Feb 26, 2004 at 07:24 UTC |