prasadbabu has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks
I have doubt in negative lookahead assertion.
<sec>here the text goes <pg> and text continuesI want to fetch the text from <sec> tag to <pg> tag, but the text fetched should not have <pg> tag. I used the following coding for the above text. is this correct? If not please clarify my doubts.
$str =~ /<sec>.*(?!<pg>)<pg>/si;Also i need to study the negative and positive look ahead and look behind assertions, where can i find the study material with good examples
Thanks in advance
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: negative look ahead
by delirium (Chaplain) on Jun 30, 2004 at 01:25 UTC | |
|
Re: negative look ahead
by ercparker (Hermit) on Jun 30, 2004 at 04:32 UTC |