in reply to Lookahead assertion confusion
Thanks. I see the error of my ways. What I wanted was to capture the pieces as long as there were no intervening <p> tags in between. Stupid me was thinking the lookahead assertion checked if the expression was anywhere in between, whereas I had specified immediately following. Expanding the lookahead expression to a more compreshensive match was the key. I ended up using this regex to do the match:
($test =~ /(<p> )(?!.*<p>.*)(.+)(features\: <ul>)/i)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Lookahead assertion confusion
by Enlil (Parson) on Jan 10, 2003 at 23:12 UTC | |
|
Re: Re: Lookahead assertion confusion
by ihb (Deacon) on Jan 10, 2003 at 22:41 UTC |