I need a regex that will match several strings in a specific order separated by anything including newlines.
So, if the 3 strings are cat
, <dog
, </bird>
then:
cat abcd
abc <dog abc
</bird>
matches, but
cat abcd
abc </bird> abc
<dog
does not.
EDIT: one more example:
catabcd
abc <dog abc
</bird>
and any such variation where the search terms are not separated by word boundaries should also match.
One final example, it should be greedy in that:
cat abcd
</bird>
<dog
<dog
cat
</bird>
Does NOT match.
I have tried lookahead:
(?=.*?cat)(?=.*?dog)(?=.*?bird).*
but this does not enforce order (and this particular example only works on one line).
Note: I am using notepad++, but can resort to perl if necessary.