Negative dir path match

General discussion related to "Everything".
Post Reply
Noitidart
Posts: 2
Joined: Sun Feb 17, 2019 9:06 pm

Negative dir path match

Post 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?
void
Developer
Posts: 16735
Joined: Fri Oct 16, 2009 11:31 pm

Re: Negative dir path match

Post by void »

Please try searching for:

es6 !\node_modules\ !\yarn\

! = NOT
Noitidart
Posts: 2
Joined: Sun Feb 17, 2019 9:06 pm

Re: Negative dir path match

Post by Noitidart »

Thank you so much void!! Works awesome!!
guyr
Posts: 3
Joined: Thu Jun 08, 2017 4:07 am

Re: Negative dir path match

Post 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.
void
Developer
Posts: 16735
Joined: Fri Oct 16, 2009 11:31 pm

Re: Negative dir path match

Post 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.
Post Reply