Regular expressions do not work (SEPARATE FOLDER NAME)

General discussion related to "Everything".
Post Reply
Debugger
Posts: 630
Joined: Thu Jan 26, 2017 11:56 am

Regular expressions do not work (SEPARATE FOLDER NAME)

Post by Debugger »

regex:[\p{IsCyrillic}]
regex:^[A-Za-z.!@?#"$%&:;() *\+,\/;\-=[\\\]\^_{|}<>\u0400-\u04FF]*$
regex:[\u0401\u0451\u0410-\u044f]
Last edited by Debugger on Sat Jan 12, 2019 7:37 pm, edited 1 time in total.
void
Developer
Posts: 17155
Joined: Fri Oct 16, 2009 11:31 pm

Re: Regular expressions do not work

Post by void »

Some suggestions:
regex:[\p{Cyrillic}]

Remember to escape spaces and | with double quotes, use a #quot: for a literal quote:
regex:"^[A-Za-z.!@?#$%&:;() *\+,\/;\-=[\\\]\^_{|}<>\x{0400}-\x{04FF}#quot:]*$"

Everything uses PCRE in non-Javascript mode, you will need to use \x{xxxx} in place of \uxxxx
regex:[\x{0401}\x{0451}\x{0410}-\x{044f}]

https://www.pcre.org/original/doc/html/pcrepattern.html
froggie
Posts: 302
Joined: Wed Jun 12, 2013 10:43 pm

Re: Regular expressions do not work

Post by froggie »

Everything uses PCRE in non-Javascript mode

https://www.pcre.org/original/doc/html/pcrepattern.html
Would be nice to have this information in Everything Help, maybe under "advanced Regex"
void
Developer
Posts: 17155
Joined: Fri Oct 16, 2009 11:31 pm

Re: Regular expressions do not work

Post by void »

Added to my TODO list, thanks for the suggestion.

I've added support for \uxxxx for the next version of Everything.
Debugger
Posts: 630
Joined: Thu Jan 26, 2017 11:56 am

Re: Regular expressions do not work

Post by Debugger »

And what is a regular expression that partially excludes the matching of folder names? I was looking for information on the internet, but to no avail. Instead of excluding names, they find what I wanted to exclude. So it works contrary to the intended one. :(
void
Developer
Posts: 17155
Joined: Fri Oct 16, 2009 11:31 pm

Re: Regular expressions do not work

Post by void »

Lookahead negative assertions.

regex:"^(?!.*folder name)"

Replace folder name with the partial folder name you wish to exclude.

To limit the results to just folders, include the following in your search:
folder:

You can also use ! in Everything as the NOT operator, for example:
folder: !"folder name"
where folder name is your partial search.

If you wish to exclude paths, by just specifying the start of the path, please try searching for:
regex:"^(?!C:\\program files)"
where C:\\program files is the path you wish to exclude, this would exclude C:\program files and C:\Program files (x86)
Debugger
Posts: 630
Joined: Thu Jan 26, 2017 11:56 am

Re: Regular expressions do not work

Post by Debugger »

regex:"[E-Z]:\\VK\s(?!.*Listy|Penpals|Postcrossing"

How to separate the PARTIAL matches of different folder names, because it does not work
vanisk
Posts: 152
Joined: Sat Oct 27, 2018 11:33 am

Re: Regular expressions do not work

Post by vanisk »

Debugger wrote: Sat Jan 12, 2019 7:35 pm regex:"[E-Z]:\\VK\s(?!.*Listy|Penpals|Postcrossing"
Its missing a close parenthesis.
regex:"[E-Z]:\\VK\s(?!.*Listy|Penpals|Postcrossing)"
Debugger
Posts: 630
Joined: Thu Jan 26, 2017 11:56 am

Re: Regular expressions do not work

Post by Debugger »

vanisk wrote: Sat Jan 12, 2019 8:29 pm
Debugger wrote: Sat Jan 12, 2019 7:35 pm regex:"[E-Z]:\\VK\s(?!.*Listy|Penpals|Postcrossing"
Its missing a close parenthesis.
regex:"[E-Z]:\\VK\s(?!.*Listy|Penpals|Postcrossing|ALL)"

Thanks, I missed an important detail :P


Still problem partial match not work ALL => ALL!!
Post Reply