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).
Answer
^(?!ABC$).*
matches all strings except ABC
.
No comments:
Post a Comment