Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^5: On zero-width negative lookahead assertions

by ysth (Canon)
on Sep 10, 2004 at 17:39 UTC ( #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? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (1)
As of 2022-01-29 06:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (74 votes). Check out past polls.

    Notices?