Help with Regex to find blank space

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
burgundy
Posts: 288
Joined: Fri Oct 16, 2009 9:50 am

Help with Regex to find blank space

Post by burgundy »

My MP3 files contain the time of the recording in the name.
To indicate the hour unit, some files use a single "h" while others use "hrs", as shown here.
The "h" or hrs" is always followed by a blank space.

1234h
1234hrs

How do I use Everything to list only files which use a single "h"? I have attempted this below but it's unsuccessful.
[0-9]h" " mp3
It tries to find any numeric digit, followed by the letter "h" and then followed by a space. All with file type mp3.
void
Developer
Posts: 19839
Joined: Fri Oct 16, 2009 11:31 pm

Re: Help with Regex to find blank space

Post by void »

Your regex search is very close.

Disable regex from the Search menu and search for:

regex:[0-9]h" " mp3




-or-

Leave regex enabled under the Search menu and search for:

[0-9]h .*\.mp3$


.* == match any character any number of times.
\. == match a literal .
mp3 == match mp3 extension
$ == match the end of the filename.
quotes are not needed when regex is enabled under the Search menu.



\dh\s.*\.mp3$


\d is the same as [0-9]
\s is the same as a space.
burgundy
Posts: 288
Joined: Fri Oct 16, 2009 9:50 am

Re: Help with Regex to find blank space

Post by burgundy »

The first suggestion works. Thank you.

Is the syntax of Regex such that this can not be done with Menu > Search > Regex enabled?

The second suggestion doesn't work. Presumably this is because my filenames contain text after the time entry. I'm sorry if this wasn't made clear.
void
Developer
Posts: 19839
Joined: Fri Oct 16, 2009 11:31 pm

Re: Help with Regex to find blank space

Post by void »

Sorry, I messed up the double quotes.

[0-9]h .*\.mp3$


quotes are not needed when regex is enabled under the Search menu.
Post Reply