Find and Replace in Path: Exclude Test Files?


Using the "Find in Path" dialogue, how do I search for a String, say "xyz" in any file, except JUnit test files (ending in *


I tried to enter the following, with no success:

  • *.java, !*
  • !*

I don't really understand the following from the help, too:

Note also, that negated pattern (for example, !*.min.js) has implicit inclusion pattern *. This allows avoiding such constructs as *, !*.min.js for every file except minified javascript).

Does that mean that !*.min.js will yield the same results as *, !*.min.js?

Comment actions Permalink

> Does that mean that !*.min.js will yield the same results as *, !*.min.js?

Yes, it's how it should work.

Comment actions Permalink

Given the Help page, I would expect the above to give me a list of all my files (especially all Java files), except for XML files (like my POM.xml). It does, however, not seem to return a single match... :'(

>> If text to find is not entered, and this check box [File mask(s)] is selected, then IntelliJ IDEA find all files matching the specified mask, regardless of their contents.

I'm running build 15.0.4 64 bit on Windows.

Comment actions Permalink

That would explain things. Doesn't explain how I ended up on the help page for 2016.1 when I pressed F1 on the 15.0.4 dialogue, though... ;-)


Please sign in to leave a comment.