http://qs321.pair.com?node_id=630354


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

See perlre

m/(?:(?!somephrase).)*/;

"A zero-width negative look-ahead assertion. For example /foo(?!bar)/ matches any occurrence of "foo" that isn't followed by "bar". Note however that look-ahead and look-behind are NOT the same thing. You cannot use this for look-behind."


They say that time changes things, but you actually have to change them yourself.

—Andy Warhol