Regex to find all matches linewise where text1("abc") is present and text2("xyz") is not present anywhere in each line.
Asked
Active
Viewed 62 times
-4
-
1@MarounMaroun Ahh... Now I get it. Good one :D – SamWhan Nov 29 '16 at 09:48
1 Answers
1
As per your order ;)
Eg.
^(?!.*xyz).*abc.*
should do the trick.
It uses a negative look-ahead to make sure the line doesn't contain the text "xyz", followed by a test any text up to "abc". And to match the whole line, followed by any text.

SamWhan
- 8,296
- 1
- 18
- 45