Regular expression not working! Bug ?

General discussion related to "Everything".
Post Reply
lemmeshowyou
Posts: 3
Joined: Mon Aug 23, 2021 8:09 am

Regular expression not working! Bug ?

Post by lemmeshowyou »

Hello

The following regex works if I test it on regex101. See screenshot

Code: Select all

^(?!.*(a|e))p.*\.pdf
firefox_2JdNOoHBXE.png
firefox_2JdNOoHBXE.png (36.51 KiB) Viewed 8804 times


If I use the above regex in evertything, I get 0 matches. However if I change it into one of the following regex then I get matches.

^(?!.*(a))p.*\.pdf
^(?!.*[ae])p.*\.pdf

So the tricky part is the

Code: Select all

(a|e)
Whats wrong ?
void
Developer
Posts: 15488
Joined: Fri Oct 16, 2009 11:31 pm

Re: Regular expression not working! Bug ?

Post by void »

| in Everything means OR

Please escape | with double quotes:

regex:"^(?!.*(a|e))p.*\.pdf"



-or-

Enable regex from the Search menu, and search for:
^(?!.*(a|e))p.*\.pdf
lemmeshowyou
Posts: 3
Joined: Mon Aug 23, 2021 8:09 am

Re: Regular expression not working! Bug ?

Post by lemmeshowyou »

well .... great .. :) many thanks :)
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: Regular expression not working! Bug ?

Post by Stamimail »

Do you think Everything needs to change something to avoid encountering such a problem?
lemmeshowyou
Posts: 3
Joined: Mon Aug 23, 2021 8:09 am

Re: Regular expression not working! Bug ?

Post by lemmeshowyou »

Maybe hint the user if the the regex does not start with a double quote. Or coloroize properties and values.
void
Developer
Posts: 15488
Joined: Fri Oct 16, 2009 11:31 pm

Re: Regular expression not working! Bug ?

Post by void »

The quotes will not be required in Everything 1.5 as the regex: search modifier will eat the | character.
kibbuz
Posts: 1
Joined: Wed Dec 22, 2021 10:01 am

Re: Regular expression not working! Bug ?

Post by kibbuz »

To me regex: ^b.* shows nothing. Where am i wrong..?
void
Developer
Posts: 15488
Joined: Fri Oct 16, 2009 11:31 pm

Re: Regular expression not working! Bug ?

Post by void »

Please make sure Enable regular expressions is unchecked under the Search menu.

Please try removing the space after regex:

regex:^b.*
Post Reply