I need help with regex.

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
ovg
Posts: 294
Joined: Thu Oct 27, 2016 7:19 pm

I need help with regex.

Post by ovg »

I'm trying to find files in all dirs except XXX YYY. regex:^((?!XXX YYY).)*$ doesn't work (result is empty).
ES doesn't work to ... I'm trying the latest versions. What I'm missing?
I'm aware about exclude option, but in this case it isn't suitable for me
void
Developer
Posts: 16671
Joined: Fri Oct 16, 2009 11:31 pm

Re: I need help with regex.

Post by void »

For example, to exclude C:\Program Files with regex:

regex:"^((?!C:\\Program Files).)*$"

Use double quotes (") to escape spaces.
Escape backslashes (\) with a backslash (\).

It might be easier (faster too) to use NOT regex:

!regex:"^C:\\Program Files"
ovg
Posts: 294
Joined: Thu Oct 27, 2016 7:19 pm

Re: I need help with regex.

Post by ovg »

Excellent!!! Thank you VERY MUCH for help.
ovg
Posts: 294
Joined: Thu Oct 27, 2016 7:19 pm

Re: I need help with regex.

Post by ovg »

Hi, David!
Your suggestions doesn't work with ES - can you help me or this is limitation of ES?
void
Developer
Posts: 16671
Joined: Fri Oct 16, 2009 11:31 pm

Re: I need help with regex.

Post by void »

They should work, I've just tested these searches with ES 1.1.

Please try ES 1.1.

es.exe regex:"^((?!C:\\Program Files).)*$"
es.exe !regex:"^C:\\Program Files"
ovg
Posts: 294
Joined: Thu Oct 27, 2016 7:19 pm

Re: I need help with regex.

Post by ovg »

Thank you very much again!
Post Reply