How to filter to video files within a folder with a matching name?
-
- Posts: 73
- Joined: Tue Jun 10, 2014 4:06 pm
How to filter to video files within a folder with a matching name?
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
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
Re: How to filter to video files within a folder with a matching name?
Untested:
Explanation will follow if this does indeed work...
Code: Select all
regex:^.*\\(.+?)\\\1\.[^\.\\]*$
-
- Posts: 73
- Joined: Tue Jun 10, 2014 4:06 pm
Re: How to filter to video files within a folder with a matching name?
Thanks, it seems to work.
- Can it be modified to match on the first 12 characters?
- Is it case insensitive?
Re: How to filter to video files within a folder with a matching name?
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.
Yes, the match between the folder and the filename are case insensitive depending on your Search -> Match Case setting.
Re: How to filter to video files within a folder with a matching name?
It is case-INsensitive
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 wrote: ↑Sun Feb 13, 2022 7:02 pm Can it be modified to match on the first 12 characters?
-
- Posts: 73
- Joined: Tue Jun 10, 2014 4:06 pm
Re: How to filter to video files within a folder with a matching name?
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
e.g. this would match
filename: 123456789012ABC.txt
folder: 123456789012
Re: How to filter to video files within a folder with a matching name?
So c:\12345\12345.txt should not match? Only if the foldername is exact 12 characters long?
-
- Posts: 73
- Joined: Tue Jun 10, 2014 4:06 pm
Re: How to filter to video files within a folder with a matching name?
hmm. no. I guess it's more like "allow suffix in filename", I'll do some homework on this.
Re: How to filter to video files within a folder with a matching name?
Does the following help:
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
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
Re: How to filter to video files within a folder with a matching name?
@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.
@zonetrooperex: To answer another part of your question; include the video: keyword to narrow down your results to videos-only.
Re: How to filter to video files within a folder with a matching name?
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:
regex:basename:^([^.]{12}) expand:parentname:\1
capture the first 12 characters in basename.
expand: will allow \1 recall for the parentname: search.
expand:
Re: How to filter to video files within a folder with a matching name?
nifty! going to have to play with expand: now.