I need help coming up with a PCRE regular expression that will find two occurrences of a word without a certain word between them in a multiline file.
The first example below should be matched because "foo" occurs twice without the word "bar" between them, while the second example should not be matched because "foo" occurs twice with the word "bar" between them.
Matching Example:
foo
jumped
over
the
lazy
foo
Nonmatching Example:
foo
jumped
over
the
bar
foo