You propose:
(?=((?!exp).)*$)
I don't believe you're right, but can't be sure, because you haven't given a method of translating an arbitrary regular expression containing a negation (?~E) into one without.For example, how would you translate:
(?~exp)a.*
which asks for "anything not exp, then an `a`, then anything"? (?=((?!exp).)*$).*a.*
is wrong, since it doesn't match "aexp". (?=((?!exp).)*$)a.*
is also wrong, for the same reason. (?=((?!exp).)*a)a.*
is wrong, because it doesn't match "expba".EDIT: argh, HN formatting rules about asterisks.