Search code examples
intellij-idea

How to exclude import and package statements from IntelliJ's Find results?


How to hide all import and packages statements in the results of "Find In Files" (previously "Find in Path") action?

enter image description here


Solution

  • As others pointed in above comments, using Regex seems to be the only viable solution for this scenario.

    I used: ^(?!import|package).*wordToSearch