I'm taking a deep dive into how regexes work and am struggling to understand how to inverse a regex which contains backreferences.
To bring an example, let's say I don't want to match the words which contain the same character pairs, where secondary pair is inversed:
Words that it must exclude:
abba // (ab/ba pair)
smelled // (el/le pair)
trillion // (il/li pair)
I have this regex which captures words like this:
(((.)(.)).*\4\3)
But how do I go with inversing it? I tried applying negative lookahead, but it does not seem to work:
(?!((((.)(.)).*\4\3))