![]() |
|
Welcome to the Monastery | |
PerlMonks |
Re: negative look aheadby delirium (Chaplain) |
on Jun 30, 2004 at 01:25 UTC ( [id://370661]=note: print w/replies, xml ) | Need Help?? |
You can do this without an assertion by making the regex not greedy: ($match) = $str =~ /<sec>(.*?)<pg>/; Try perldoc.com and look at the POD "perlre" for some information about lookaheads and behinds. They're neat, but a lot of times they can be avoided by rethinking what you're searching for.
In Section
Seekers of Perl Wisdom
|
|