Regular expression to match a line that doesn’t contain a word
The notion that regex doesn’t support inverse matching is not entirely true. You can mimic this behavior by using negative look-arounds: ^((?!hede).)*$ Non-capturing variant: ^(?:(?!:hede).)*$ The regex above will match any string, or line without a line break, not containing the (sub)string ‘hede’. As mentioned, this is not something regex is “good” at (or should … Read more