Page 1 of 1

Negative dir path match

Posted: Sun Feb 17, 2019 9:08 pm
by Noitidart
In summary: Search for file containing word, but the file should not be in child/grandchild of folder named "node_modules" or "yarn"

In detail: I am trying to search for the word "es6". But all of my */node_modules/* or */yarn/* folders have so many of these. I need to exclude all node_module folders, is this possible?

Re: Negative dir path match

Posted: Sun Feb 17, 2019 9:11 pm
by void
Please try searching for:

es6 !\node_modules\ !\yarn\

! = NOT

Re: Negative dir path match

Posted: Sun Feb 17, 2019 11:21 pm
by Noitidart
Thank you so much void!! Works awesome!!

Re: Negative dir path match

Posted: Sun Feb 24, 2019 2:35 am
by guyr
Follow up with similar question. Everything version 1.4.1.935 (x64)

I want to search in directory d:\docs, but exclude top-level subdirectory "eM Client". I tried this:

d:\docs\ !"eM Client"

This eliminates just 1 result of 48,405, though I don't know which; the eM Client subdirectory contains 870 files and 16 directories.

If I click Search - Match Path, then the eM Client subdirectory is removed from the results.

The following regex also works: d:\\docs\\((?!eM\sClient).)

So, why do I need to use Match Path for this to work?

Thanks.

Re: Negative dir path match

Posted: Sun Feb 24, 2019 4:06 am
by void
Please try searching for:
d:\docs\ !"d:\docs\eM Client\"

or simply:
d:\docs\ !"eM Client\"

Using a \ in your search term will temporarily enable full path matching for that term.