Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: negative look ahead

by delirium (Chaplain)
on Jun 30, 2004 at 01:25 UTC ( [id://370661]=note: print w/replies, xml ) Need Help??


in reply to negative look ahead

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.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2024-03-29 01:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found