laziness, impatience, and hubris | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
...regex /([^:]+)/ which tells perl to eat everything until it reaches the ":". ...unless the input begins with a colon, when the regex will start its eating i. e. matching after the leading colon(s).
So the "exact" equivalent to /([^:]+)/ would be /((?:.(?!stop))+.)/, while the "eat up until" case might be something like /\G((?!stop)(?:.(?!stop))+.)/, corresponding /([^:]*)/, or so I hope.
In reply to Re: Tell regex to stop at "phrase", instead of char - how?
by pKai
|
|