Ending with 3 but not 4 digits

A swapping-ground for Regular Expression syntax

Ending with 3 but not 4 digits

Postby Hasse » Mon Nov 13, 2017 1:50 pm

I have a number of files ending with 3 or 4 digits.
How do I find only the ones with 3 digits at the end, but not the ones with less than or more than 3 digits at the end.

They all start with the word Serie, followed by an underscore.
There is always an underscore before the digits at the end.
The number of letters before the last underscore can vary.

Example:
1) Serie_abc_123.jpg
2) Serie_abcd_456.jpg
3) Serie_abcde_789.jpg
4) Serie_def_1234.jpg
5) Serie_defg_1234.jpg
6) Serie_defg_12.jpg
7) Serie_hij_12345.jpg

I want the ones on row 1, 2 and 3 but not the ones on row 4, 5, 6 or 7.
Hasse
 
Posts: 10
Joined: Sat Jul 16, 2016 4:52 pm

Re: Ending with 3 but not 4 digits

Postby KenP » Mon Nov 13, 2017 2:05 pm

If you want to filter the file names ending with 3 digits this should work.

Filters (12)
Mask: .*_\d{3}.jpg
RegEx: selected
KenP
 
Posts: 199
Joined: Sat Jul 30, 2016 11:25 am

Re: Ending with 3 but not 4 digits

Postby Hasse » Mon Nov 13, 2017 7:08 pm

Thank you!
It worked just as I wanted.
Hasse
 
Posts: 10
Joined: Sat Jul 16, 2016 4:52 pm


Return to Regular Expressions