How to filter to video files within a folder with a matching name?

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
zonetrooperex
Posts: 73
Joined: Tue Jun 10, 2014 4:06 pm

How to filter to video files within a folder with a matching name?

Post by zonetrooperex »

Is it possible in Everything to:

show video files where the folders they exists within match their file name.

:?: :?

e.g.

filename: example-video.mp4

that exists in the folder: example-video
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: How to filter to video files within a folder with a matching name?

Post by NotNull »

Untested:

Code: Select all

regex:^.*\\(.+?)\\\1\.[^\.\\]*$ 
Explanation will follow if this does indeed work...
zonetrooperex
Posts: 73
Joined: Tue Jun 10, 2014 4:06 pm

Re: How to filter to video files within a folder with a matching name?

Post by zonetrooperex »

Thanks, it seems to work.
  • Can it be modified to match on the first 12 characters?
  • Is it case insensitive?
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: How to filter to video files within a folder with a matching name?

Post by raccoon »

The first 12 characters of the folder name, matching the first 12 characters of the file name? Or 12 characters anywhere in the folder matching 12 characters anywhere in the file? You have to be specific about anchorage.

Yes, the match between the folder and the filename are case insensitive depending on your Search -> Match Case setting.
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: How to filter to video files within a folder with a matching name?

Post by NotNull »

It is case-INsensitive
zonetrooperex wrote: Sun Feb 13, 2022 7:02 pm Can it be modified to match on the first 12 characters?
The answer is yes, but I have no idea what you actually mean. Can you give an example (or two) of files/folders that should match/ should not match?
zonetrooperex
Posts: 73
Joined: Tue Jun 10, 2014 4:06 pm

Re: How to filter to video files within a folder with a matching name?

Post by zonetrooperex »

I mean the prefix for the filename (matching the first 12 characters of the file name).

e.g. this would match

filename: 123456789012ABC.txt
folder: 123456789012
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: How to filter to video files within a folder with a matching name?

Post by NotNull »

So c:\12345\12345.txt should not match? Only if the foldername is exact 12 characters long?
zonetrooperex
Posts: 73
Joined: Tue Jun 10, 2014 4:06 pm

Re: How to filter to video files within a folder with a matching name?

Post by zonetrooperex »

hmm. no. I guess it's more like "allow suffix in filename", I'll do some homework on this.
void
Developer
Posts: 16775
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to filter to video files within a folder with a matching name?

Post by void »

Does the following help:

Code: Select all

regex:^.*\\([^\\]{12})[^\\]*\\\1[^\\]*$ 

regex: = enable regex
^ = match start of filename
.*\\ = match any character up to a literal \
([^\\]{12}) = match any character except \ 12 times and capture the group.
[^\\]*\\ = match any character except \ up to a literal \
\1 = match the previous group capture.
[^\\]*$ = match any character except \ up to the end of the filename
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: How to filter to video files within a folder with a matching name?

Post by raccoon »

@void: Are there any weird string tricks for matching parentpath: as a startswith: in basename:? Just curious.

@zonetrooperex: To answer another part of your question; include the video: keyword to narrow down your results to videos-only.
void
Developer
Posts: 16775
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to filter to video files within a folder with a matching name?

Post by void »

The following comes to mind:

regex:basename:^([^.]{12}) expand:parentname:\1

capture the first 12 characters in basename.
expand: will allow \1 recall for the parentname: search.



expand:
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: How to filter to video files within a folder with a matching name?

Post by raccoon »

nifty! going to have to play with expand: now.
Post Reply