in reply to Match something that does not match
It seems to me like the feature you're implementing could be described as "stop matching at" (Update: or "match until") rather than do_not_match. Your current regex in do_not_match can be simplified to qr{ (?: (?!$pat) . )* }x; at least that still passes all your test cases. (This regex is pretty simple; I'm not sure if it warrants inclusion in Regexp::Common.)
Update: WebPerl Regex Tester
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Match something that does not match
by jo37 (Curate) on Feb 15, 2020 at 20:42 UTC | |
by haukex (Archbishop) on Feb 15, 2020 at 21:41 UTC | |
by jo37 (Curate) on Feb 15, 2020 at 22:18 UTC |