Issues with Everything and regex

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
mheartley72
Posts: 7
Joined: Mon Feb 20, 2023 12:49 pm

Issues with Everything and regex

Post by mheartley72 »

Hello and good day,

I have a inquiry about Everything and I'm actually quite confused.

I know there maybe a different way to do this however I'm attempting to keep my old feeble mind sharp when it comes to regex so I am attempting to exercise this knowledge some. :)

Here is my ponderence. I'm doing a statement that looks for both the .jpg and .jpeg extensions with regex. When I activate the regex via menu option/keyboard shortcut, the following statement works like a charm.

\.\jp(g|eg)


This returns what I expect to see.

However because I also want to just show a certain time/date range, I want to enable the regex parameter without it being global so I can use the dm: function.

However when I just put this into Everything regex:\.\jp(g|eg), it returns only one file and it is not even a picture file!

Am I using the regex: parameter incorrectly? I have done similar statements and it has worked correctly. I will admit in those other scenarios, I was not looking for an extension nor was i telling Everyting in those instances to substitute the ending with two different variants.

Thank you for your time and if someone more versed in this tool can maybe show a shortcut that I could file away for reference, I will appreciate that input as well.
mheartley72
Posts: 7
Joined: Mon Feb 20, 2023 12:49 pm

Re: Issues with Everything and regex

Post by mheartley72 »

Here is some screenshots to hopefully better illustrate the issue.
regex parameter used in search bar.jpg
regex parameter used in search bar.jpg (94.39 KiB) Viewed 1757 times
regex used globally .jpg
regex used globally .jpg (429.85 KiB) Viewed 1757 times
therube
Posts: 4646
Joined: Thu Sep 03, 2009 6:48 pm

Re: Issues with Everything and regex

Post by therube »

You want,
regex:\.jp(e?)g
.
Says to match "jp" AND "e", zero or 1 times, AND g.

You might want to add a $ to to only match at the end of the name
regex:\.jp(e?)g$
.


You could also use,
ext:jpg;jpeg
.


(g|eg)
, say to match:
g OR | OR e OR g
not g OR "eg"
NotNull
Posts: 5298
Joined: Wed May 24, 2017 9:22 pm

Re: Issues with Everything and regex

Post by NotNull »

regex:\.\jp(g|eg)

regex and Everything BOTH use the | as an OR operator.
In this case, Everything "wins" and will split the search in two separate ones:
  • regex:\.\jp(g
  • eg)
The first part before the OR does not produce any meaningful results.
The regex mode stops after that and a normal search for eg) will find your single .lng file

To tell Everything the | belongs to the regex query, enclose the regular expressions in "":
regex:"\.\jp(g|eg)"



There is an extra unneeded backslash in your regular expression.
Replace
\.\jp(g|eg)
with
\.jp(g|eg)
:

Code: Select all

regex:"\.jp(g|eg)"
Do you get the expected results with this new search?
mheartley72
Posts: 7
Joined: Mon Feb 20, 2023 12:49 pm

Re: Issues with Everything and regex

Post by mheartley72 »

Hello and good day,

I did see that Everything used the | operator as or however because I put it after the regex: option, I figured that it would be parsed through regex and not through Everything.

You are correct that I did put an extra escape character in. See what happens when older folks don’t keep using regex.

Thank you for looking into it however I was under the impression that using “” would not parse the | correctly.

I’ll give it a go when I get a moment.

Thanks again!
NotNull
Posts: 5298
Joined: Wed May 24, 2017 9:22 pm

Re: Issues with Everything and regex

Post by NotNull »

mheartley72 wrote: Mon Feb 20, 2023 11:40 pm I figured that it would be parsed through regex and not through Everything.
Everything 1.5 - currently in development - will handle it this way (at least: it looks like it)
mheartley72
Posts: 7
Joined: Mon Feb 20, 2023 12:49 pm

Re: Issues with Everything and regex

Post by mheartley72 »

NotNull wrote: Mon Feb 20, 2023 11:58 pm
mheartley72 wrote: Mon Feb 20, 2023 11:40 pm I figured that it would be parsed through regex and not through Everything.
Everything 1.5 - currently in development - will handle it this way (at least: it looks like it)
Good to know! Thank you for the info!
mheartley72
Posts: 7
Joined: Mon Feb 20, 2023 12:49 pm

Re: Issues with Everything and regex

Post by mheartley72 »

therube wrote: Mon Feb 20, 2023 4:05 pm You want,
regex:\.jp(e?)g
.
Says to match "jp" AND "e", zero or 1 times, AND g.

You might want to add a $ to to only match at the end of the name
regex:\.jp(e?)g$
.


You could also use,
ext:jpg;jpeg
.


(g|eg)
, say to match:
g OR | OR e OR g
not g OR "eg"
Good info especially the extension operator! Thanks!
Post Reply