Irfan Basha
Irfan Basha

Reputation: 31

Can we search 2 strings which has to be in a same line in NotePad++?

I want to search for strings in notepad++ which has strings "XYZ" and "ERROR" in the same line.

I've tried to search with XYZ.*ERROR but the issue is that it returns the lines with only ERROR,only XYZ, and both XYZ and ERROR.

Eg: My records look somewhat like this:

The application XYZ has a ERROR
XYZ is a good application
The application WXYZ has a ERROR
ERROR in server

Now when I search, I want only line 1 to be returned in the search result. However, I am getting every line in the search which defeats the purpose.

Upvotes: 0

Views: 2197

Answers (1)

Toto
Toto

Reputation: 91385

Insert word boundaries around your keywords:

\bXYZ\b.*\bERROR\b

Screenshot:

enter image description here

Upvotes: 2

Related Questions