Is there any way to match any string that is not a specific string? Like the opposite effect of "abc" Does "^abc" match any string that is not "abc"? ------------------------------------------------------------------------- Supprizingly there is not such a feature in regex. Definitly, "^abc" does not mean any string that is not "abc" https://stackoverflow.com/questions/7317043/regex-not-operator However, you can use negative lookahead and lookbehind to simulate the effect. Since negative lookbehind is not fully implemented in JavaScript across browsers, this will be a real headack.