Regular expressions do not work (SEPARATE FOLDER NAME)

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

Regular expressions do not work (SEPARATE FOLDER NAME)

Post by Debugger » Wed Jan 02, 2019 3:25 pm

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
Site Admin
Posts: 4927
Joined: Fri Oct 16, 2009 11:31 pm

Re: Regular expressions do not work

Post by void » Thu Jan 03, 2019 12:13 am

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: 129
Joined: Wed Jun 12, 2013 10:43 pm

Re: Regular expressions do not work

Post by froggie » Thu Jan 03, 2019 2:33 pm

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
Site Admin
Posts: 4927
Joined: Fri Oct 16, 2009 11:31 pm

Re: Regular expressions do not work

Post by void » Fri Jan 04, 2019 12:57 am

Added to my TODO list, thanks for the suggestion.

I've added support for \uxxxx for the next version of Everything.

Debugger
Posts: 531
Joined: Thu Jan 26, 2017 11:56 am

Re: Regular expressions do not work

Post by Debugger » Sat Jan 12, 2019 10:32 am

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
Site Admin
Posts: 4927
Joined: Fri Oct 16, 2009 11:31 pm

Re: Regular expressions do not work

Post by void » Sat Jan 12, 2019 11:38 am

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: 531
Joined: Thu Jan 26, 2017 11:56 am

Re: Regular expressions do not work

Post by Debugger » Sat Jan 12, 2019 7:35 pm

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: 150
Joined: Sat Oct 27, 2018 11:33 am

Re: Regular expressions do not work

Post by vanisk » 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)"

Debugger
Posts: 531
Joined: Thu Jan 26, 2017 11:56 am

Re: Regular expressions do not work

Post by Debugger » Sat Jan 12, 2019 8:48 pm

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