Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Notepad++ (v5.9), I want to search for files which contain two words. For example, I would like to find all text files in a directory that have both Alpha and Bravo in the file. They may not be next to each other and they may have multiple occurrences of either. I just want to find the files that have at least one instance of each.

Is there a way to structure this search without resorting to Regular Expressions?

Thanks for the advice.

share|improve this question
Any reason you're sticking to Notepad++ for file searching? A simple search tool like Agent Ransack might be a better than sticking with the built-in search? – snowdude Oct 16 '12 at 9:10
A junior engineer asked me about it. She has Notepad++ installed and uses it regularly. There is no reason to only search with that tool, but that's how the question came to me. I'll give Agent Ransack a look over. – SethO Oct 16 '12 at 13:59
up vote 2 down vote accepted

Edit: sorry, I missed the without resorting to Regular Expressions. Sadly, you'll need to use a RegEx to do this as far as I know. I've setup the RegEx below for you.

Under find in files use Alpha.*Bravo in the Find what select Regular expression and .matches newline. Select the Directory to search in and you should find your files.

If you need them in other order as well, you can do the same inverting the words: Bravo.*Alpha

If there is different case possibilities you'll need to show that IE [aA]lpha.*[bB]ravo

share|improve this answer
Thanks, Jeff. I don't mind using RegEx. I was trying to help out someone who doesn't have much experience with it. Time to teach! – SethO Oct 13 '12 at 3:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .