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?? |
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.
In Section
Seekers of Perl Wisdom
|
|