Find all strings except one string using regex

regex

Solution

^(?!ABC$).*

matches all strings except `ABC`.

Problem

I want to match all strings except the string `"ABC"`. Example: ``` "A" --> Match "F" --> Match "AABC" --> Match "ABCC" --> Match "CBA" --> Match "ABC" --> No match ``` I tried with `[^ABC]`, but it ignores `"CBA"` (and others).

Original source

Related problems