C# Regex to match a string that doesn’t contain a certain string? August 5, 2023 by Tarik try this: ^(?!.*DontMatchThis).*$