Say the string not equal to foo
nor bar
. How to write the regex?
Asked
Active
Viewed 18 times
0
-
1`^(?!(?:foo|bar)$)` or `^(?!(?:foo|bar)$).*` – Wiktor Stribiżew Oct 23 '17 at 09:03
-
@WiktorStribiżew Although I don't understand it, it works. – bijiDango Oct 23 '17 at 09:05
-
Paste into http://regex101.com and read the explanation on the right. – Wiktor Stribiżew Oct 23 '17 at 09:06