-1

I searched on the web & also tried below mentioned linked pages, but I did not get the solution.

In Windows Explorer, how to search files whose Names contain any digits or numbers? Or does the file name contain digits/numbers within the given range?

How do I do a search from Windows Explorer for numbers in filename? How do I do a search from Windows Explorer for numbers in filename? As per the last link above, we must have put hard-coded numbers to search. For example, if we type in a search box like Filename:~="88" (numbers Hard Coded), the search result displays all files that have 88 in their name, but if we want to search for any number, like filename:~="###" (if single '#' represent any single Number), the result shows all files which have literal ### in the name.

Also, try filename~="###" but no success.

Another issue is how to search files that have numbers within a given particular range of numbers like Filename:~="2..7"? (~ means Contain) After studying Advanced Query Syntax & other sources, there are not any symbols or operators available to use that represent any number.

Though "?" handles any single alphabet, number & special character, when required only a number or digit, there are no available symbols for that.

How to find files, and names that contain numbers that fall between particular given numbered ranges? like Filename:=~"5..9" (May be Double Dot for a range between From..To don't know the exact syntax)

2 Answers2

2

Use multiple explicit conditions involving the digits that you want to find. For example, for digits 1, 2, and 3:

System.FileName:~~1 OR System.FileName:~~2 OR System.FileName:~~3

This says, "the file name contains 1 OR the file name contains 2 OR the file name contains 3".

As for finding a range of whole numbers, e.g. 500 through 600, this does not seem to be possible using Windows Search. I recommend FileLocator Pro instead, which supports regular expressions.

0

I just want to add some clarification for the usage in the actual search window in Windows Explorer.

Basic Concept

To make things quick(er), you can simply type combinations of strings like ~="3", though I prefer the quicker ~~"3"

As I discuss different things, I'll show the search box and possibly results in one of the two ways below.

One way I find clearer and less cluttered, as

,-------,
| ~="3" |
'-------'

or I can include as a screenshot, which helps show details.

enter image description here

or even a smaller screenshot

Only the search bar in Windows Explorer. Contains the characters, tilde equals double-quote three double-quote. ||| If you're reading this on the screen, the original image source is broken. Click the text here to go to an archived version of the image at https://archive.org/download/smaller_screenshot_example/smaller_screenshot_example.png

Examples from OP

So, I've made a small directory including filenames from the list that brought me to this question.

enter image description here

for what could be grep-ped as [2-7] and what you've suggested as Filename:~="2..7" (I wish File Explorer would let us do that.)

,----------------------------------------------------,
| ~~"2" OR ~~"3" OR ~~"4" OR ~~"5" OR ~~"6" OR ~~"7" |
'----------------------------------------------------'

enter image description here

For those who wonder how this answers the question, note that the only thing this gets you is less typing. There are also, doubtless, instances where not using the Filename:~~"2" (alternately Filename:~="2", System.Filename:~~2, System.Filename:~="2") changes the search results. I would love to hear details about that from whomever knows.

A note about the quotation marks

I appreciate this post, as well as the answers and comments, partly because of what I'll be adding here. When I didn't use the quotes, I got unforeseen results.

I'll give an example with 3

,-----,
| ~=3 |
'-----'

which gave

enter image description here

Using the quotes

,-------,
| ~="3" |
'-------'

enter image description here

got me what was expected.

That helped me to find what I really wanted – the first labeled image for each base.

enter image description here

The OP even mentioned,

[I]f we type in a search box like Filename:~="88" (numbers Hard Coded), the search result displays all files that have 88 in their name[.]

which got me what I needed. I'm hoping my shorter-form answer as well as reference to the command line will help others.

Another option using the command prompt

cf. https://superuser.com/a/1904217/908741

I hope to add more details, later.


Oh comments. Sometimes I guess I'm Hit-Enter-Too-Soon-Man : )