Searching for anything that starts with anyletters + s

General discussion related to "Everything".
Post Reply
filipeteles
Posts: 18
Joined: Thu Mar 24, 2016 9:53 am

Searching for anything that starts with anyletters + s

Post by filipeteles »

I'm trying to do a query, that will search for any file that begins with any 1 or 2 characters and then the letter.

For instance:

1s
11s
3s
4s
19s

So I have this query:
1s*

What should I swap the 1 with?

Thanks!
void
Developer
Posts: 16747
Joined: Fri Oct 16, 2009 11:31 pm

Re: Searching for anything that starts with anyletters + s

Post by void »

Search for files that begin with 1 or 2 digits followed by s:
regex:^\d{1,2}s

regex: = enable regular expressions
^ = match start of filename.
\d = match a digit.
{1,2} = match the previous term 1 to 2 times. In this case 1-2 digits.
s = match a single literal s.

Search for files that begin with 1 or 2 characters (any characters) followed by s:
regex:^.{1,2}s

Using wildcards to search for 1 character (any characters) followed by s:
?s*

Using wildcards to search for 2 characters (any characters) followed by s:
??s*

Combining the two:
?s* | ??s*
filipeteles
Posts: 18
Joined: Thu Mar 24, 2016 9:53 am

Re: Searching for anything that starts with anyletters + s

Post by filipeteles »

Thanks, that was quick.

What if I also want it to end with
.wav
void
Developer
Posts: 16747
Joined: Fri Oct 16, 2009 11:31 pm

Re: Searching for anything that starts with anyletters + s

Post by void »

regex:^\d{1,2}s.*\.wav$

regex: = enable regular expressions
^ = match start of filename.
\d = match a digit.
{1,2} = match the previous term 1 to 2 times. In this case 1-2 digits.
s = match a single literal s.
. = match any character
* = match the previous term zero or more times, in this case match any character zero or more times.
\. = match a single literal .
wav = match the string wav
$ = match the end of the filename.

or, with wildcards, where ? can match any character:
?s*.wav | ??s*.wav
filipeteles
Posts: 18
Joined: Thu Mar 24, 2016 9:53 am

Re: Searching for anything that starts with anyletters + s

Post by filipeteles »

that works


i tried to change it to:
regex:^\d{1,3}s.*\.wav$


but its not querying items with 3 digits
void
Developer
Posts: 16747
Joined: Fri Oct 16, 2009 11:31 pm

Re: Searching for anything that starts with anyletters + s

Post by void »

Are you sure you have a filename with 3 digits with a s and the .wav extension?

Can you give an example filename that does not match?
filipeteles
Posts: 18
Joined: Thu Mar 24, 2016 9:53 am

Re: Searching for anything that starts with anyletters + s

Post by filipeteles »

my bad, it is querying it
Last edited by filipeteles on Thu Sep 14, 2017 8:39 am, edited 1 time in total.
void
Developer
Posts: 16747
Joined: Fri Oct 16, 2009 11:31 pm

Re: Searching for anything that starts with anyletters + s

Post by void »

Please make sure Match Path and Match Case are both unchecked from the Search menu.
filipeteles
Posts: 18
Joined: Thu Mar 24, 2016 9:53 am

Re: Searching for anything that starts with anyletters + s

Post by filipeteles »

ok a more complex one


what if i want to find files that before the 1-3 digits + s have the following:

10A -
1A -
2B -
12B -

For instance:

10A - 102s
1B - 1s
12B - 15s


with up to 3 digits before the A or B and up to three digits before the s
is it:

regex:^\d{1,3}A|B" - "d{1,3}s.*\.wav$
void
Developer
Posts: 16747
Joined: Fri Oct 16, 2009 11:31 pm

Re: Searching for anything that starts with anyletters + s

Post by void »

regex:^\d{1,3}[ab]" - "\d{1,3}s.*\.wav$

[ab] = Match A or B
filipeteles
Posts: 18
Joined: Thu Mar 24, 2016 9:53 am

Re: Searching for anything that starts with anyletters + s

Post by filipeteles »

genius!!!! thanks again mate!
Post Reply