Search for files with specific naming convention

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
CCarmichael
Posts: 15
Joined: 28 Apr 2022 13:07

Search for files with specific naming convention

Post by CCarmichael »

Hi,

I'm trying to unify how a large collection of images are named, however some over time have had a different last number format applied i.e. end with 2 numbers instead of 3 as demonstrated below, and I was wondering whether it were possible to search for these specific files using a script.

Some examples are:
Files I want to find so I can rename them: set-title-date taken-01.jpg
Files I want to ignore from the search: set-title-date taken-001.jpg

Does this make sense? Is this possible?

Any help would be greatly appreciated.

highend
Posts: 14925
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Search for files with specific naming convention

Post by highend »

You can simply do this via a normal search term: >.+?-\d{2}\.jpg$
One of my scripts helped you out? Please donate via Paypal

CCarmichael
Posts: 15
Joined: 28 Apr 2022 13:07

Re: Search for files with specific naming convention

Post by CCarmichael »

That's brilliant, thanks very much.

admin
Site Admin
Posts: 66091
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Search for files with specific naming convention

Post by admin »

A simpler non-regexp would have done the job as well: *-##.jpg

PS: This needs a tick at "Configuration | Find and Filter | Find Files & Branch View | Find Files | Enable extended pattern matching", otherwise # does not stand for "any digit". Alternatively use the E switch: *-##.jpg /E.

Post Reply