RegEx to tell if a string does not contain a specific character
Easy question this time. I'm trying to test whether or not a string does not contain a character using regular expressions. I thought the expression was of the form "[^ x ]" where x is the character that you don't want to appear, but that doesn't seem to be working. For example, Regex.IsMatch("103","[^0]") and Regex.IsMatch("103&","[^&]") both return true (I would expect false). I started using "[^&]" and thought maybe the & needed to be escaped as \&, but it didn't seem to make a difference. Ideas? I assume it's something small. Also, I'm using .NET, so keep that in mind. Edit1: I found this