[search] Notepad++: Multiple words search in a file (may be in different lines)?

How can we perform multiple search for multiple words and the line containing them. These words can be in same or different lines. For example:

1.The CAT goes up and down the ROAD.
2. The DOG goes up and down the CITY.
3. The HORSE goes up and down the TOWN.
4. The DONKEY goes up and down the TOWN.

Now, I wish to do a search for the lines containing CAT and TOWN in one shot. So, I would get the output as line 1, 3, 4 in sequence. That would be the same way we do in Unix (more file | egrep "CAT|TOWN").

How can we do it in Notepad++??

This question is related to search notepad++

The answer is


Possible solution

  1. In Notepad++ , click search menu, the click Find
  2. in FIND WHAT : enter this ==> cat|town
  3. Select REGULAR EXPRESSION radiobutton
  4. click FIND IN CURRENT DOCUMENT

Screenshot


<shameless-plug>

Search+ is a notepad++ plugin that does exactly this. You can download it from here and install it following the steps mentioned here

Feel free to post any issues/suggestions here.

</shameless-plug>


If you are using Notepad++ editor (like the tag of the question suggests), you can use the great "Find in Files" functionality.

Go to SearchFind in Files (Ctrl+Shift+F for the keyboard addicted) and enter:

  • Find What = (cat|town)

  • Filters = *.txt

  • Directory = enter the path of the directory you want to search in. You can check Follow current doc. to have the path of the current file to be filled.

  • Search mode = Regular Expression