in reply to Re: "Not containing something" in substitution
in thread "Not containing something" in substitution
I just have too much free time ;-)use re 'eval'; $begin = '[xyz]'; $end = '[/xyz]'; $string = '[xyz]level 1.1 [xyz]level 2.1[/xyz] rest of 1.1 [/xyz]'; $re = qr{ \Q$begin\E (?: (?> (?:(?!=\Q$begin\E|\Q$end\E).)+ ) | (??{ $re }) )* \Q$end\E }x; print 'Yeah!' if $string =~ $re;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: "Not containing something" in substitution
by Aristotle (Chancellor) on Aug 28, 2003 at 12:57 UTC |