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 » Sun Feb 17, 2019 9:08 pm

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
Site Admin
Posts: 4825
Joined: Fri Oct 16, 2009 11:31 pm

Re: Negative dir path match

Post by void » Sun Feb 17, 2019 9:11 pm

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 » Sun Feb 17, 2019 11:21 pm

Thank you so much void!! Works awesome!!

guyr
Posts: 2
Joined: Thu Jun 08, 2017 4:07 am

Re: Negative dir path match

Post by guyr » Sun Feb 24, 2019 2:35 am

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
Site Admin
Posts: 4825
Joined: Fri Oct 16, 2009 11:31 pm

Re: Negative dir path match

Post by void » Sun Feb 24, 2019 4:06 am

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