Hey everyone,
I cant figure out searching for a file name that has a fixed number of characters after a unique word, I'm trying to search for "Photo_AZ123456789" where the AZ1-9 is different for each file but same length.
Appreciate any suggestions.
Search for X number of characters in file name
Re: Search for X number of characters in file name
I'm not sure where "simple" wildcards stand, so a regex: that should work:
Will find words that starts (^) with the word "photo", are followed by an underscore (_), followed by (in my example) any nine characters (.), followed by nothing further ($).
Adjust as needed.
As written, it will find, "photo_finder.zip".
If you remove the starts with (^), it will find, "awesome_photo_finder.zip".
Adjust the number of dots (.) to fit your needs. ...
regex:^photo_........$
Will find words that starts (^) with the word "photo", are followed by an underscore (_), followed by (in my example) any nine characters (.), followed by nothing further ($).
Adjust as needed.
As written, it will find, "photo_finder.zip".
If you remove the starts with (^), it will find, "awesome_photo_finder.zip".
Adjust the number of dots (.) to fit your needs. ...
Re: Search for X number of characters in file name
You can use a ? wildcard to specify one single character:
(11 question marks; 2 for the letters and 9 for the numbers).
More exact, but more difficult too, would be using regular expressions:
Subtitled: Search for files that:
- start with photo_
- followed by two characters in the range a-z
- followed by nine numbers (0-9)
- followed by a dot ( . )
- and ends with jpg
regular expression searches in Everything are case insensitive, so it will find az as well as AZ or aZ
@therube: sorry, missed your reply ...
photo_???????????.jpg
More exact, but more difficult too, would be using regular expressions:
regex:"^photo_[a-z]{2}[0-9]{9}\.jpg$"
Subtitled: Search for files that:
- start with photo_
- followed by two characters in the range a-z
- followed by nine numbers (0-9)
- followed by a dot ( . )
- and ends with jpg
regular expression searches in Everything are case insensitive, so it will find az as well as AZ or aZ
@therube: sorry, missed your reply ...
Re: Search for X number of characters in file name
Perfect, thanks to @therube as well.
for future reference, how can I use both expressions [a-z][0-9]{3}$ to search for files when numbers and letters aren't in order? like AZ8, A8Z, 8AZ?
for future reference, how can I use both expressions [a-z][0-9]{3}$ to search for files when numbers and letters aren't in order? like AZ8, A8Z, 8AZ?
NotNull wrote: ↑Tue Jun 01, 2021 3:17 pm You can use a ? wildcard to specify one single character:
(11 question marks; 2 for the letters and 9 for the numbers).photo_???????????.jpg
More exact, but more difficult too, would be using regular expressions:
regex:"^photo_[a-z]{2}[0-9]{9}\.jpg$"
Subtitled: Search for files that:
- start with photo_
- followed by two characters in the range a-z
- followed by nine numbers (0-9)
- followed by a dot ( . )
- and ends with jpg
regular expression searches in Everything are case insensitive, so it will find az as well as AZ or aZ
@therube: sorry, missed your reply ...
Re: Search for X number of characters in file name
This should do it (untested):
[a-z0-9]{3}
(made i a bit larger as there was hardly any difference visible between [] and {}. At least on my system)