in reply to "everything but" regex

A character class is just that, a character class. A character class will either match a single character, or it won't. It cannot be used for negative matching of multi-character strings. The character class [^(mystring)] will match any character that is not (, m, y, s, t, r, i, n, g, or ).

You can get the effect you want with a negative look-ahead assertion: /^(?!mystring\z)/; That's basically equivalent to (but much less readable than): $_ ne 'mystring';