I have a regex but it is very big. I specify the set of chars that I allow.
That makes it big regex expression. Will it be simpler if I can specify the opposite i.e. just specify what chars I won’t accept?
^[^\|\^~]*$
But it is not working. Any clue?
This matches strings that do not contain those three characters anywhere:
While this matches all strings that contain any of those three anywhere:
The two patterns are equivalent, so you could either use the first one, or use the second one with negation.