Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Tell regex to stop at "phrase", instead of char - how?

by ikegami (Patriarch)
on Aug 03, 2007 at 12:17 UTC ( [id://630494]=note: print w/replies, xml ) Need Help??


in reply to Re: Tell regex to stop at "phrase", instead of char - how?
in thread Tell regex to stop at "phrase", instead of char - how?

No, it doesn't work. To work, it not only needs to match when it should match, it needs to not mach when it shouldn't match. Yours fails to do the latter.

/([^(stop)]+)/ is the same as /([^()opst]+)/. It doesn't look for "stop" at all, just individual characters.

You basically took the regexp the OP said didn't work, and made it not work in more places. For example, your solution stops wherever a paren is encountered.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (8)
As of 2024-04-19 15:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found