Regex help

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
salazor
Posts: 258
Joined: Tue Jun 17, 2014 10:52 am

Regex help

Post by salazor »

I needs your help, I'm not fluent in Regex - I have to find the files in the range -149 to -160

original name is gerse-14987 or otyr-15734 or hertam-16043 - All are 5 digital

I created

Code: Select all

-149{3}|-15[0-9]{3}|-160{3}
but not quite working properly.
therube
Posts: 4605
Joined: Thu Sep 03, 2009 6:48 pm

Re: Regex help

Post by therube »

(I'm not very good, but) maybe something like this:

Code: Select all

-149\d\d|-1[56]\d\d\d
(that's not going to do it is, it... maybe i look later.)
salazor
Posts: 258
Joined: Tue Jun 17, 2014 10:52 am

Re: Regex help

Post by salazor »

In all works, only now found also -161 or -168
but on 160** ends
froggie
Posts: 297
Joined: Wed Jun 12, 2013 10:43 pm

Re: Regex help

Post by froggie »

how about

Code: Select all

-(149|15\d|160)\d\d
therube
Posts: 4605
Joined: Thu Sep 03, 2009 6:48 pm

Re: Regex help

Post by therube »

Cool. I like that.

And you can tack on a \D to avoid something like hertam-160436 (six digits).

Code: Select all

-(149|15\d|160)\d\d\D
salazor
Posts: 258
Joined: Tue Jun 17, 2014 10:52 am

Re: Regex help

Post by salazor »

It works perfectly, but I noticed a small mistake - if I choose from the menu "Enable Regex" it works well, but if I typed

Code: Select all

regex:-(149|15\d|160)\d\d
Regex from menu disabled - no results

Is it possible to combine the command like this:

Code: Select all

regex:-(149|15\d|160)\d\d dupe:
void
Developer
Posts: 15315
Joined: Fri Oct 16, 2009 11:31 pm

Re: Regex help

Post by void »

regex:"-(149|15\d|160)\d\d" dupe:

Use double quotes to escape the |
salazor
Posts: 258
Joined: Tue Jun 17, 2014 10:52 am

Re: Regex help

Post by salazor »

Now it works, thanks.
Post Reply