REGEX:PROPERTIES
REGEX:PROPERTIES
I'm new to regex, and I wanna isolate/filter my file search by numerical characters so I've used [0-9] which works. But i also want to limit my filename count; (i.e. filenamelength:10) but it doesn't work in regex. How do I fix this?
Re: REGEX:PROPERTIES
Instead of using Regex from the search menu, use the regex: search modifier.
Please try the following search:
regex:[0-9] len:10
How many digits-characters do you want to match?
Is it just one?
or do you want to match filenames with all digits:
regex:^[0-9]+$ len:10
^ = match the start of the filename
+ = match the previous element one or more times.
$ = match the end of the filename.
Is there a file extension?
regex:^[0-9]+\.[^.]+$ len:10
\. = match a literal .
[^.] = do not match a literal dot.
If you wanted to match exactly 10 digits in pure regex (regex enabled from the Search menu), please try the following search:
^[0-9]{10}$
{x} = match the previous element x times.
Please try the following search:
regex:[0-9] len:10
How many digits-characters do you want to match?
Is it just one?
or do you want to match filenames with all digits:
regex:^[0-9]+$ len:10
^ = match the start of the filename
+ = match the previous element one or more times.
$ = match the end of the filename.
Is there a file extension?
regex:^[0-9]+\.[^.]+$ len:10
\. = match a literal .
[^.] = do not match a literal dot.
If you wanted to match exactly 10 digits in pure regex (regex enabled from the Search menu), please try the following search:
^[0-9]{10}$
{x} = match the previous element x times.
Re: REGEX:PROPERTIES
Thank you that was very helpful! However I wanted to isolate filenames with just numerical values. For example:
including:
i.e; 0145960100.jpg
excluding:
i.e; 009BHIX009.jpg
I hope that makes sense.
including:
i.e; 0145960100.jpg
excluding:
i.e; 009BHIX009.jpg
I hope that makes sense.
Re: REGEX:PROPERTIES
I'm sorry I think you answered my question in the second part of your answer. That totally worked! Thank you!
Re: REGEX:PROPERTIES
Please try:i.e; 0145960100.jpg
regex:^\d{10}\.jpg$
^ = match start of filename
\d = match a DIGIT -same as [0-9]
{10} = match 10 of the previous element
\. = match a literal dot (.)
$ = match the end of the filename