This should work, but doesn't
Code-Snippet
Code: Select all
(_(20(..)) Nr.*\.20(?!\2)(..))Nr.*\.20: Matches the separator text between them.
(?!\2): Negative Lookahead. This asserts that the characters immediately following do not match whatever was captured in Group 2. If they do match, the regex engine fails and rejects the match.
(.{2})): Group 3 captures the second suffix, which is guaranteed to be different from Group 2 because of the lookahead check.
Limitations of this approach:
This relies on the engine's ability to evaluate a backreference inside a lookahead ((?!\2)), which is supported in advanced regex flavors like PCRE (PHP/Perl), Python, and .NET
AFAIK this should be the .NET regex in Everything?