Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^5: On zero-width negative lookahead assertions

by ysth (Canon)
on Sep 10, 2004 at 17:39 UTC ( [id://390141]=note: print w/replies, xml ) Need Help??


in reply to Re^4: On zero-width negative lookahead assertions
in thread On zero-width negative lookahead assertions

To make it behave as you describe, use (?>\s*). The (?> ) says whatever is in it will match whatever it would match at that point in the string as an independent expression. So if matching all the spaces makes something later on fail, it won't backtrack and try having the \s* match fewer spaces.

(It's really time to unmark all of the extensions as experimental, except perhaps how variables in (?{}) and (??{}) bind.)

  • Comment on Re^5: On zero-width negative lookahead assertions

Log In?
Username:
Password:

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

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

    No recent polls found