Is it possible to ignore a specific match in a regular expression?
For example:
I have the following regular expression:
^[0-9]{2}$
But I don’t want to match a specific string, let’s say “12”.
I think I’m looking for something like an and operator for regular expressions, but haven’t been able to find anything like this in .NET / C#.
I would prefer to do this in the regular expression itself.
Any advice or suggestion?
Or the reverse:
Note that in this specific case, negating 1 specific match was easy. Sometimes it isn’t, an sometimes it’s (nigh) impossible, depends on the regex.