Quote Originally Posted by stlaural View Post
Then this would be it :

^((?!regular).)*pattern((?!regular).)*$
Very close, but not quite. Should not have the begining and end of string characters in the pattern because that will require matching of the whole input string. The OP wants to match substrings (line) within the input string, so the pattern should be like this:
Code:
(?<=\n)((?!regular).)*pattern((?!regular).)*