@DLosc Here's what'd be equivalent to Regenerate's
(A!B)
in mainstream regex:
(A|(?!A)B)
or
(?(?=A)A|B)
(or
(?(A)A|B)
in .NET). As a universal drop-in replacement for
(A!B)
(ignoring that backreferences need renumbering), they must duplicate
A
. But
my regex engine with
-xlcnd,ml
, it'd be
(?(?*(A))\1|B)
where
\1
is whatever group number
(A)
captures, where
(?(?*condition)yes|no)
is a molecular lookahead conditional.