Search Regex vs regex:

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
therube
Posts: 4955
Joined: Thu Sep 03, 2009 6:48 pm

Search Regex vs regex:

Post by therube »

Search Regex vs regex

Result: Screen Shot 2017-09-16 at 23.33.54 2

---

Why does this work; Enable Regex from Search menu (Ctrl+R)

^screen shot.*\s\d\d.\d\d.\d\d\s2$

Where these do not

regex:(^Screen Shot.*\s\d\d\.\d\d\.\d\d\s1$)

Oh, so I have to escape the space between Screen and Shot (or "." it).

regex:(^Screen\sShot.*\s\d\d\.\d\d\.\d\d\s2)

Alternatively I could use quotes

regex:"Screen Shot.*\s\d\d.\d\d.\d\d 2"


hmm.
void
Developer
Posts: 16684
Joined: Fri Oct 16, 2009 11:31 pm

Re: Search Regex vs regex:

Post by void »

When regex is disabled, the normal Everything search syntax applies.

space = AND

For example, search for regex:abc and the text 123:
regex:abc 123

Use double quotes to escape spaces and |s.

Please try searching for:
regex:^screen" "shot.*\s\d\d.\d\d.\d\d\s2$
or:
regex:"^screen shot.*\s\d\d.\d\d.\d\d\s2$"

regex:(abc 123) is still two terms, regex:(abc AND 123)
regex:<abc 123> is still two terms, regex:abc AND regex:123

I am going to allow regex: to eat the | in the next version of Everything, but not a space. You will need to continue to escape spaces when using regex:
Stamimail
Posts: 1122
Joined: Sat Aug 31, 2013 9:05 pm

Re: Search Regex vs regex:

Post by Stamimail »

Adding Foreground color and/or Background color to Search Edit, is this an option to get over such misunderstanding?
In this case the user will be able to distinguish where the function was ended.
therube
Posts: 4955
Joined: Thu Sep 03, 2009 6:48 pm

Re: Search Regex vs regex:

Post by therube »

Ah, OK, that makes sense (though I will reread it a few more times).
Now, lets hope I will remember this the next time I run into it ;-).
Post Reply