Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Lookahead assertion confusion

by Enlil (Parson)
on Jan 10, 2003 at 21:08 UTC ( [id://225957]=note: print w/replies, xml ) Need Help??


in reply to Lookahead assertion confusion

Let's break this down and see if you can't find the problem:
/(<p> ) # #1 (.+(?!<p>)) # #2 (features\: <ul>)/ix) # #3

1. the pattern must start with <p> followed by a space
2. afterwhich the pattern must grab as much as it can provided that #3 is statisfied and that whatever .+ matches cannot be followed by <p>.
3. the pattern has to end with features: <ul>
all this is case insensitive.

so if you look at it once more you realize that nowhere is rule #2 broken as it is not followed by a <p> what you are looking for is more along these lines:my ($first, $second, $third) = ($test =~ /(<p> ).+?<p>(.+)(features: <ul>)/i);

update:being human, I assosciate significance to big round numbers in a, more often times than not, strange superstitious manner. and thus i mark post 100

-enlil

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://225957]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-24 07:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found