How can I search for files with "numbers" only as name?

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
LuckyDucky
Posts: 2
Joined: Fri Jan 28, 2022 12:28 am

How can I search for files with "numbers" only as name?

Post by LuckyDucky »

example:

8125138.mp4
720p_428519.avi
16-04-07.jpg


I want to search for videos/images that ONLY have numbers. Or rather, not contain any letters, since symbols such as "_", "-", or "." might be in-between, or at the end for the extension.

can I do that with everything?
void
Developer
Posts: 16745
Joined: Fri Oct 16, 2009 11:31 pm

Re: How can I search for files with "numbers" only as name?

Post by void »

Please try the following search:

regex:\d+.*\.[^.]*$ !regex:[a-z].*\.[^.]*$

regex:\d+.*\.[^.]*$ = match at least one digit (ignoring extension)
\d = match a digit (0-9)
.* = match any character any number of times.
\. = match a literal .
[^.]* = match any character (except .) any number of times
$ = match the end of the filename.
!regex:[a-z].*\.[^.]$ = don't match any filenames with a character between a-z (ignoring extension)



If you would like to match a single letter (for example the p in 720p), try the following to match at least two letters:
regex:\d+.*\.[^.]*$ !regex:[a-z][a-z].*\.[^.]*$
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: How can I search for files with "numbers" only as name?

Post by raccoon »

Yeah, I got pretty much the same solution.

no resolution "p" permitted
<pic:|video:> regex:\\[^a-z]+\.[^.]+$

with resolution "p" permitted
<pic:|video:> regex:\\(?:[^a-z]|\d\d\dp)+\.[^.]+$
LuckyDucky
Posts: 2
Joined: Fri Jan 28, 2022 12:28 am

Re: How can I search for files with "numbers" only as name?

Post by LuckyDucky »

void wrote: Fri Jan 28, 2022 1:13 am Please try the following search:

regex:\d+.*\.[^.]*$ !regex:[a-z].*\.[^.]*$

regex:\d+.*\.[^.]*$ = match at least one digit (ignoring extension)
\d = match a digit (0-9)
.* = match any character any number of times.
\. = match a literal .
[^.]* = match any character (except .) any number of times
$ = match the end of the filename.
!regex:[a-z].*\.[^.]$ = don't match any filenames with a character between a-z (ignoring extension)



If you would like to match a single letter (for example the p in 720p), try the following to match at least two letters:
regex:\d+.*\.[^.]*$ !regex:[a-z][a-z].*\.[^.]*$
It works! Thank you.
user123
Posts: 28
Joined: Sat Jan 23, 2021 4:16 pm

Re: How can I search for files with "numbers" only as name?

Post by user123 »

I need to find files that contain 8 digit (from 0-9) long file names.
I use this regex pattern:

Code: Select all

/^[0-9]{8}$/
But it doesn't work. Can anyone tell where is the problem ?
therube
Posts: 4977
Joined: Thu Sep 03, 2009 6:48 pm

Re: How can I search for files with "numbers" only as name?

Post by therube »

Looks to work,
regex:/\d\d\d\d\d\d\d\d$
.

I think that if you have PATH enabled, that may interfere.
So disable PATH or use nopath:.
user123
Posts: 28
Joined: Sat Jan 23, 2021 4:16 pm

Re: How can I search for files with "numbers" only as name?

Post by user123 »

Strange, but even with PATH disabled and no folder path in search bar, it can't find anything, even though i have hundreds of files with just 8 digits.
11aaa.png
11aaa.png (8.28 KiB) Viewed 5515 times
void
Developer
Posts: 16745
Joined: Fri Oct 16, 2009 11:31 pm

Re: How can I search for files with "numbers" only as name?

Post by void »

Please try:

regex:\d{8,}

\d = digit (0-9)
{8,} = match previous element 8 times or more times.



Do you want to match filenames starting with the number? -if so, please try:

regex:^\d{8,}

^ = match start of filename.



If you have match path enabled, please try:

regex:name:^\d{8,}

name: = match name part only.



If you want to match a filename with exactly 8 digits:

regex:^\d{8}$

$ = match end of filename.



Do you want to ignore the extension? -If so, please try the stem: search function:

regex:stem:^\d{8}$

stem: = match name without extension.
user123
Posts: 28
Joined: Sat Jan 23, 2021 4:16 pm

Re: How can I search for files with "numbers" only as name?

Post by user123 »

Thanks. These are working.
Post Reply