C # Regex to match a string that does not contain a certain string?

advertisements

I want to match any string that does not contain the string "DontMatchThis".

What's the regex?


try this:

^(?!.*DontMatchThis).*$