2

I am looking for the pattern to use the windows explorer search bar to find all files (Not folders) in the current directory and all sub directories that start with the pattern 1- for example the file 1-file.txt should be found but the file 1file.txt not

I tried several syntax approaches that I know from GNU Grep or SED.

But the windows search bar always returns non sense, like files that just contain the number 1 somewhere in the filename.

1

Are you open to using 3rd party tools? If you are, Everything by voidtools.com is pretty good and has very fast search capability. The tool indexes your whole computer and show you result as you typed.

1
  • works well out of the box fast index, understandable which data will be scanned. Does not try to connect to the internet (a lot of freeware does) Aug 5 '21 at 12:45
1

In some delightfully hard-to-find MS Documentation, there's information regarding several string-specific query operators. One of them is COP_VALUE_STARTSWITH:

Operator: COP_VALUE_STARTSWITH
Symbol: ~<
Example: System.FileName:~<"C++ Primer"
Description: Finds items where the file name begins with the characters "C++ Primer".

So, to find only files that begin with "1-", use:

FileName:~<1-

Other operators include:

  • COP_VALUE_ENDSWITH: ~>
  • COP_VALUE_CONTAINS: ~= or ~~
  • COP_VALUE_NOTCONTAINS: ~!
  • COP_DOSWILDCARDS: ~

VALUE_CONTAINS overcomes the default word-based (as opposed to character-based) nature of Windows Indexing. Using name:~~cess:

enter image description here

DOSWILDCARDS allows the wildcard characters ? and * to be used in quoted strings. And characters that are part of seach syntax, such as (, ), [, and ], must be in quotes to interpreted as search characters. So to find files that have parenthetical indices at the end of the filename, use FileName:~"*(*).*"

enter image description here

Again, the complete list is here:

Using Advanced Query Syntax Programmatically - Query Operators

0

See http://hs.windows.microsoft.com/hhweb/content/m-en-us/p-6.2/id-8d6963c6-f737-4009-a061-22cbb976bdc3/

name:"1-*.*"

But the options on the search tab affect what will happen.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.