=============version =============
Operation system: win10 1903
Everything: Version 1.4.1.992 (x64)
Hi Team,
i know the Regex Syntax, e.g:
^ Matches the start of the filename
$ Matches the end of the filename
while can they be used simultaneously, i mean, i want to search out the files with their name match the 2 criteria at the same time. e.g., ther're 3 files named: abc1.txt abc2.txt abc3.txt
i want to search them out simultaneously, i try to use
^abc .txt$
or
^abc $txt
both can't fulfill the request. so the question is: can the different Regex Syntax be used at the same time?
thank you.
can the Regex Syntax be used simultaneously?
Re: can the Regex Syntax be used simultaneously?
Code: Select all
regex:^abc\d\.txt$
Code: Select all
regex:^abc.\.txt$
Re: can the Regex Syntax be used simultaneously?
Hi ovg,
i just tried your method, it works, thanks.
but...
won't work. i.e.: not sure why "abc" is mandatory, does it mean 3 characters are minimal to input here for it working as expected?
thanks.
i just tried your method, it works, thanks.
but...
Code: Select all
regex:^a.\.txt$
regex:^a\d\.txt$
regex:^ab.\.txt$
regex:^ab\d\.txt$
thanks.
Re: can the Regex Syntax be used simultaneously?
Sorry, but it seems that you don't know about regex. (BTW I don't want to insult or offend you)
www.regex101.com
www.regular-expressions.info
www.regex101.com
www.regular-expressions.info
Re: can the Regex Syntax be used simultaneously?
The most common used regex options can also be found in the Everything menu: Help > Regex Syntax (also available online )
Quick explanation:
The most important one for you is the "."
In the regex language that means: one single character.
If you want to search for a "." , like in ".txt", you have to tell the regex 'engine' that you want a literal "." and not the wildcard "."
"\." (without the "") will do that for you.
So, If you want to search for "abc" - random character - ".txt" using regex, you get:
And If you want to search for "abc" - multiple random characters - ".txt" using regex, you get:
\d is regex-speak for: 1 digit
Quick explanation:
The most important one for you is the "."
In the regex language that means: one single character.
If you want to search for a "." , like in ".txt", you have to tell the regex 'engine' that you want a literal "." and not the wildcard "."
"\." (without the "") will do that for you.
So, If you want to search for "abc" - random character - ".txt" using regex, you get:
Code: Select all
^abc.\.txt$
Code: Select all
^abc.*\.txt$
\d is regex-speak for: 1 digit
Re: can the Regex Syntax be used simultaneously?
hi NotNull,
thank you for your in detailed explanation, it help me to understand the logic here.
but, as i replied previously, i still don't know why it need "abc"(3 characters), can it work for 1 character, or 2 characters(sometimes, just remember 1-2 characters ^^)?
thank you.
thank you for your in detailed explanation, it help me to understand the logic here.
but, as i replied previously, i still don't know why it need "abc"(3 characters), can it work for 1 character, or 2 characters(sometimes, just remember 1-2 characters ^^)?
thank you.
NotNull wrote: ↑Sun Nov 08, 2020 4:26 pm The most common used regex options can also be found in the Everything menu: Help > Regex Syntax (also available online )
Quick explanation:
The most important one for you is the "."
In the regex language that means: one single character.
If you want to search for a "." , like in ".txt", you have to tell the regex 'engine' that you want a literal "." and not the wildcard "."
"\." (without the "") will do that for you.
So, If you want to search for "abc" - random character - ".txt" using regex, you get:And If you want to search for "abc" - multiple random characters - ".txt" using regex, you get:Code: Select all
^abc.\.txt$
Code: Select all
^abc.*\.txt$
\d is regex-speak for: 1 digit
Re: can the Regex Syntax be used simultaneously?
regex:^a.\.txt$
Will search for files that start with an "a", followed by one (1) random character, followed by ".txt" and no more characters after that.
(total filename length = 6)
regex:^a\d\.txt$
Will search for files that start with an "a", followed by one (1) digit, followed by ".txt" and no more characters after that.
(total filename length = 6)
regex:^ab.\.txt$
Will search for files that start with "ab", followed by one (1) random character, followed by ".txt" and no more characters after that.
(total filename length = 7)
regex:^ab\d\.txt$
Will search for files that start with "ab", followed by one (1) digit, followed by ".txt" and no more characters after that.
(total filename length = 7)
Take a good look at the description of "*".
I guess you want something like regex:^ab.*\d\.txt$
Another alternative would be:
FWIW: You don't *need* regex to accomplish this. You could also search in Everything for - forexample - :
startwith:abc endwith:.txt
See Menu:Help > Search Syntax
Will search for files that start with an "a", followed by one (1) random character, followed by ".txt" and no more characters after that.
(total filename length = 6)
regex:^a\d\.txt$
Will search for files that start with an "a", followed by one (1) digit, followed by ".txt" and no more characters after that.
(total filename length = 6)
regex:^ab.\.txt$
Will search for files that start with "ab", followed by one (1) random character, followed by ".txt" and no more characters after that.
(total filename length = 7)
regex:^ab\d\.txt$
Will search for files that start with "ab", followed by one (1) digit, followed by ".txt" and no more characters after that.
(total filename length = 7)
Take a good look at the description of "*".
I guess you want something like regex:^ab.*\d\.txt$
Another alternative would be:
Code: Select all
regex:^abc regex:\.txt$
startwith:abc endwith:.txt
See Menu:Help > Search Syntax
Re: can the Regex Syntax be used simultaneously?
Hi Mr./Mrs NotNull,
what a good teacher you're here!
i finally see what i expected here based on your teaching:
this is what i could imagine at the end of the day,
and yup, i noticed the "Menu:Help > Search Syntax", but the purpose here is using 2 or more criteria:
"a & txt" here, anyway, startwith or endwith, i also tried it based on what you guide, and it also works.
also with Mr./Mrs ovg, you also guide a lot which is amazing to learn(though too much seems like from the start) ^^.
what a lively environment here, thank you a lot, have a nice day ahead!
what a good teacher you're here!
i finally see what i expected here based on your teaching:
Code: Select all
regex:^a.*.txt$
and yup, i noticed the "Menu:Help > Search Syntax", but the purpose here is using 2 or more criteria:
"a & txt" here, anyway, startwith or endwith, i also tried it based on what you guide, and it also works.
also with Mr./Mrs ovg, you also guide a lot which is amazing to learn(though too much seems like from the start) ^^.
what a lively environment here, thank you a lot, have a nice day ahead!