in reply to Tell regex to stop at "phrase", instead of char - how?
...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 Section
Seekers of Perl Wisdom