Using es.exe regex with multple OR terms

General discussion related to "Everything".
Post Reply
JimB
Posts: 2
Joined: Sun Nov 30, 2025 6:06 pm

Using es.exe regex with multple OR terms

Post by JimB »

I am using es 1.1.0.30 and everything 1.4.1.1030 (x64) on Windows 11.

My regex is:
^(p[0-9]{7}|img_[0-9]{4}|dsc[0-9]{5})[.]jpg$
which runs fine using everything.

I escaped ^ and | for the cli regex:
^^(p[0-9]{7}^|img_[0-9]{4}^|dsc[0-9]{5})[.]jpg$
but no joy.

Any help is appreciated.

JimB
void
Developer
Posts: 19830
Joined: Fri Oct 16, 2009 11:31 pm

Re: Using es.exe regex with multple OR terms

Post by void »

ES wraps the search with the regex: modifier, which Everything 1.4 doesn't handle too well..

Please try wrapping your search in double quotes instead:

Code: Select all

es -r "^(p[0-9]{7}|img_[0-9]{4}|dsc[0-9]{5})[.]jpg$"
JimB
Posts: 2
Joined: Sun Nov 30, 2025 6:06 pm

Re: Using es.exe regex with multple OR terms

Post by JimB »

Thanks it worked--for my case, I had to escape the beginning and ending double quotes (")
-r \"^(p[0-9]{7}|img_[0-9]{4}|dsc[0-9]{5})[.]jpg$[b]\"[/b]
Post Reply