'Name (5)', 'Reformat Date'

Would you like Bulk Rename Utility to offer new functionality? Post your comments here!

'Name (5)', 'Reformat Date'

Postby Bog_Standard » Fri Sep 04, 2026 2:41 pm

I have found the option 'Name (5)', 'Reformat Date', to be useful and versatile in its implementation, however it only reformats the first-found date-like number.

It also does not pass over an already formatted date to detect a second date.

Could it be possible to make it continue to the end of the filename and so capture date pairs?

My present workaround is to use Name Segment to start after the first date position and make a second pass.

Regards...
Bog_Standard
 
Posts: 4
Joined: Fri Aug 22, 2025 8:53 pm

Re: 'Name (5)', 'Reformat Date'

Postby TheGhost78 » Sat Sep 05, 2026 3:23 pm

Here are some filters using RegEx, if you want to find date issues and handle them in one go. The 'protected' versions prevent matching dates within longer numbers, such as 12024-05-31.

Loose Date Filter YMD Or DMY/MDY
Protected:
^.*(?<!\d)(?:\d{4}[- _]\d{2}[- _]\d{2}|\d{2}[- _]\d{2}[- _]\d{4})(?!\d).*$
Unprotected:
^.*(?:\d{4}[- _]\d{2}[- _]\d{2}|\d{2}[- _]\d{2}[- _]\d{4}).*$


Range-Validated Date Filter, YMD Or DMY Or MDY (Years 0000–9999)
Protected:
^.*(?<!\d)(?:\d{4}[- _](?:0[1-9]|1[0-2])[- _](?:0[1-9]|[12]\d|3[01])|(?:0[1-9]|[12]\d|3[01])[- _](?:0[1-9]|1[0-2])[- _]\d{4}|(?:0[1-9]|1[0-2])[- _](?:0[1-9]|[12]\d|3[01])[- _]\d{4})(?!\d).*$
Unprotected:
^.*(?:\d{4}[- _](?:0[1-9]|1[0-2])[- _](?:0[1-9]|[12]\d|3[01])|(?:0[1-9]|[12]\d|3[01])[- _](?:0[1-9]|1[0-2])[- _]\d{4}|(?:0[1-9]|1[0-2])[- _](?:0[1-9]|[12]\d|3[01])[- _]\d{4}).*$


Range-Validated Date Filter, YMD Or DMY Or MDY (Years 1900-2099)
Protected:
^.*(?<!\d)(?:(?:19|20)\d{2}[- _](?:0[1-9]|1[0-2])[- _](?:0[1-9]|[12]\d|3[01])|(?:0[1-9]|[12]\d|3[01])[- _](?:0[1-9]|1[0-2])[- _](?:19|20)\d{2}|(?:0[1-9]|1[0-2])[- _](?:0[1-9]|[12]\d|3[01])[- _](?:19|20)\d{2})(?!\d).*$
Unprotected:
^.*(?:(?:19|20)\d{2}[- _](?:0[1-9]|1[0-2])[- _](?:0[1-9]|[12]\d|3[01])|(?:0[1-9]|[12]\d|3[01])[- _](?:0[1-9]|1[0-2])[- _](?:19|20)\d{2}|(?:0[1-9]|1[0-2])[- _](?:0[1-9]|[12]\d|3[01])[- _](?:19|20)\d{2}).*$


Partially Qualified (Without Leap-Year Validation) Date Filter, YMD Or DMY Or MDY (Years 0000–9999)
Protected:
^.*(?<!\d)(?:\d{4}[- _](?:(?:0[13578]|1[02])[- _](?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)[- _](?:0[1-9]|[12]\d|30)|02[- _](?:0[1-9]|1\d|2[0-9]))|(?:(?:0[1-9]|[12]\d|3[01])[- _](?:0[13578]|1[02])|(?:0[1-9]|[12]\d|30)[- _](?:0[469]|11)|(?:0[1-9]|1\d|2[0-9])[- _]02)[- _]\d{4}|(?:(?:0[13578]|1[02])[- _](?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)[- _](?:0[1-9]|[12]\d|30)|02[- _](?:0[1-9]|1\d|2[0-9]))[- _]\d{4})(?!\d).*$
Unprotected:
^.*(?:\d{4}[- _](?:(?:0[13578]|1[02])[- _](?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)[- _](?:0[1-9]|[12]\d|30)|02[- _](?:0[1-9]|1\d|2[0-9]))|(?:(?:0[1-9]|[12]\d|3[01])[- _](?:0[13578]|1[02])|(?:0[1-9]|[12]\d|30)[- _](?:0[469]|11)|(?:0[1-9]|1\d|2[0-9])[- _]02)[- _]\d{4}|(?:(?:0[13578]|1[02])[- _](?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)[- _](?:0[1-9]|[12]\d|30)|02[- _](?:0[1-9]|1\d|2[0-9]))[- _]\d{4}).*$


Partially Qualified (Without Leap-Year Validation) Date Filter, YMD Or DMY Or MDY (Years 1900–2099)
Protected:
^.*(?<!\d)(?:(?:19|20)\d{2}[- _](?:(?:0[13578]|1[02])[- _](?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)[- _](?:0[1-9]|[12]\d|30)|02[- _](?:0[1-9]|1\d|2[0-9]))|(?:(?:0[1-9]|[12]\d|3[01])[- _](?:0[13578]|1[02])|(?:0[1-9]|[12]\d|30)[- _](?:0[469]|11)|(?:0[1-9]|1\d|2[0-9])[- _]02)[- _](?:19|20)\d{2}|(?:(?:0[13578]|1[02])[- _](?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)[- _](?:0[1-9]|[12]\d|30)|02[- _](?:0[1-9]|1\d|2[0-9]))[- _](?:19|20)\d{2})(?!\d).*$
Unprotected:
^.*(?:(?:19|20)\d{2}[- _](?:(?:0[13578]|1[02])[- _](?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)[- _](?:0[1-9]|[12]\d|30)|02[- _](?:0[1-9]|1\d|2[0-9]))|(?:(?:0[1-9]|[12]\d|3[01])[- _](?:0[13578]|1[02])|(?:0[1-9]|[12]\d|30)[- _](?:0[469]|11)|(?:0[1-9]|1\d|2[0-9])[- _]02)[- _](?:19|20)\d{2}|(?:(?:0[13578]|1[02])[- _](?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)[- _](?:0[1-9]|[12]\d|30)|02[- _](?:0[1-9]|1\d|2[0-9]))[- _](?:19|20)\d{2}).*$


Fully Qualified (Including Leap-Year Validation) Date Filter, YMD Or DMY Or MDY (Years 0001–9999)
Protected:
^.*(?<!\d)(?:(?!0000)\d{4}[- _](?:(?:0[13578]|1[02])[- _](?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)[- _](?:0[1-9]|[12]\d|30)|02[- _](?:0[1-9]|1\d|2[0-8]))|(?!(?:0000))(?:(?:\d{2}(?:0[48]|[2468][048]|[13579][26])|(?:[02468][048]|[13579][26])00))[- _]02[- _]29|(?:(?:0[1-9]|[12]\d|3[01])[- _](?:0[13578]|1[02])|(?:0[1-9]|[12]\d|30)[- _](?:0[469]|11)|(?:0[1-9]|1\d|2[0-8])[- _]02)[- _](?!0000)\d{4}|29[- _]02[- _](?!(?:0000))(?:(?:\d{2}(?:0[48]|[2468][048]|[13579][26])|(?:[02468][048]|[13579][26])00))|(?:(?:0[13578]|1[02])[- _](?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)[- _](?:0[1-9]|[12]\d|30)|02[- _](?:0[1-9]|1\d|2[0-8]))[- _](?!0000)\d{4}|02[- _]29[- _](?!(?:0000))(?:(?:\d{2}(?:0[48]|[2468][048]|[13579][26])|(?:[02468][048]|[13579][26])00)))(?!\d).*$
Unprotected:
^.*(?:(?!0000)\d{4}[- _](?:(?:0[13578]|1[02])[- _](?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)[- _](?:0[1-9]|[12]\d|30)|02[- _](?:0[1-9]|1\d|2[0-8]))|(?!(?:0000))(?:(?:\d{2}(?:0[48]|[2468][048]|[13579][26])|(?:[02468][048]|[13579][26])00))[- _]02[- _]29|(?:(?:0[1-9]|[12]\d|3[01])[- _](?:0[13578]|1[02])|(?:0[1-9]|[12]\d|30)[- _](?:0[469]|11)|(?:0[1-9]|1\d|2[0-8])[- _]02)[- _](?!0000)\d{4}|29[- _]02[- _](?!(?:0000))(?:(?:\d{2}(?:0[48]|[2468][048]|[13579][26])|(?:[02468][048]|[13579][26])00))|(?:(?:0[13578]|1[02])[- _](?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)[- _](?:0[1-9]|[12]\d|30)|02[- _](?:0[1-9]|1\d|2[0-8]))[- _](?!0000)\d{4}|02[- _]29[- _](?!(?:0000))(?:(?:\d{2}(?:0[48]|[2468][048]|[13579][26])|(?:[02468][048]|[13579][26])00))).*$


Fully Qualified (Including Leap-Year Validation) Date Filter, YMD Or DMY Or MDY (Years 1900–2099)
Protected:
^.*(?<!\d)(?:(?:19|20)\d{2}[- _](?:(?:0[13578]|1[02])[- _](?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)[- _](?:0[1-9]|[12]\d|30)|02[- _](?:0[1-9]|1\d|2[0-8]))|(?:19(?:0[48]|[2468][048]|[13579][26])|20(?:00|0[48]|[2468][048]|[13579][26]))[- _]02[- _]29|(?:(?:0[1-9]|[12]\d|3[01])[- _](?:0[13578]|1[02])|(?:0[1-9]|[12]\d|30)[- _](?:0[469]|11)|(?:0[1-9]|1\d|2[0-8])[- _]02)[- _](?:19|20)\d{2}|29[- _]02[- _](?:19(?:0[48]|[2468][048]|[13579][26])|20(?:00|0[48]|[2468][048]|[13579][26]))|(?:(?:0[13578]|1[02])[- _](?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)[- _](?:0[1-9]|[12]\d|30)|02[- _](?:0[1-9]|1\d|2[0-8]))[- _](?:19|20)\d{2}|02[- _]29[- _](?:19(?:0[48]|[2468][048]|[13579][26])|20(?:00|0[48]|[2468][048]|[13579][26])))(?!\d).*$
Unprotected:
^.*(?:(?:19|20)\d{2}[- _](?:(?:0[13578]|1[02])[- _](?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)[- _](?:0[1-9]|[12]\d|30)|02[- _](?:0[1-9]|1\d|2[0-8]))|(?:19(?:0[48]|[2468][048]|[13579][26])|20(?:00|0[48]|[2468][048]|[13579][26]))[- _]02[- _]29|(?:(?:0[1-9]|[12]\d|3[01])[- _](?:0[13578]|1[02])|(?:0[1-9]|[12]\d|30)[- _](?:0[469]|11)|(?:0[1-9]|1\d|2[0-8])[- _]02)[- _](?:19|20)\d{2}|29[- _]02[- _](?:19(?:0[48]|[2468][048]|[13579][26])|20(?:00|0[48]|[2468][048]|[13579][26]))|(?:(?:0[13578]|1[02])[- _](?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)[- _](?:0[1-9]|[12]\d|30)|02[- _](?:0[1-9]|1\d|2[0-8]))[- _](?:19|20)\d{2}|02[- _]29[- _](?:19(?:0[48]|[2468][048]|[13579][26])|20(?:00|0[48]|[2468][048]|[13579][26]))).*$
TheGhost78
 
Posts: 277
Joined: Fri Jul 19, 2024 11:25 am

Re: 'Name (5)', 'Reformat Date'

Postby TheGhost78 » Sat Sep 05, 2026 3:36 pm

You can then use RegEx (1) match and replace expressions to get them into the format you want. For example:

Match:
(?<!\d)((?:19|20)\d{2})[- _](0[1-9]|1[0-2])[- _](0[1-9]|[12]\d|3[01])(?!\d)(?X)(?<!\d)(0[1-9]|[12]\d|3[01])[- _](0[1-9]|1[0-2])[- _]((?:19|20)\d{2})(?!\d)(?X)(?<!\d)(0[1-9]|1[0-2])[- _](0[1-9]|[12]\d|3[01])[- _]((?:19|20)\d{2})(?!\d)

Replace:
\1-\2-\3(?X)\3-\2-\1(?X)\3-\1-\2

Or for multiple instances of dates within a single filename:

Match:
(?<!\d)((?:19|20)\d{2})[- _](0[1-9]|1[0-2])[- _](0[1-9]|[12]\d|3[01])(?!\d)/g(?X)(?<!\d)(0[1-9]|[12]\d|3[01])[- _](0[1-9]|1[0-2])[- _]((?:19|20)\d{2})(?!\d)/g(?X)(?<!\d)(0[1-9]|1[0-2])[- _](0[1-9]|[12]\d|3[01])[- _]((?:19|20)\d{2})(?!\d)/g


N.B. You will need closer, manual scrutiny of any ambiguous dates if there is a mixture of DMY and MDY formats in your filenames; e.g. 05-06-2025 could be May 6th 2025 (MDY) or 5th June 2025 (DMY).

If you know there is only one date format in your filenames, then just delete the irrelevant match and replace expressions and only use the correct one.


This version will ignore ambiguous DMY / MDY dates like 05-06-2025:

Match:
(?<!\d)(?|((?:19|20)\d{2})[- _](\d{2})[- _](\d{2})|(?=(?:1[3-9]|2\d|3[01])[- _](?:0[1-9]|1[0-2])[- _]((?:19|20)\d{2})(?!\d))(?=(?:1[3-9]|2\d|3[01])[- _](0[1-9]|1[0-2])[- _](?:19|20)\d{2}(?!\d))(1[3-9]|2\d|3[01])[- _](?:0[1-9]|1[0-2])[- _](?:19|20)\d{2}|(?=(?:0[1-9]|1[0-2])[- _](?:1[3-9]|2\d|3[01])[- _]((?:19|20)\d{2})(?!\d))(0[1-9]|1[0-2])[- _](1[3-9]|2\d|3[01])[- _](?:19|20)\d{2})(?!\d)/g

Replace:
\1-\2-\3
TheGhost78
 
Posts: 277
Joined: Fri Jul 19, 2024 11:25 am

Re: 'Name (5)', 'Reformat Date'

Postby TheGhost78 » Sun Sep 06, 2026 12:54 am

To be really specific, in case you have files with more than one successive date in its filename, you can use Perl syntax. Stack each of these expressions if you want to standardise the date format, or just use a single one if you know they are all currently in a particular format.

YMD to YMD
Match:
(?<!\d)((?:19|20)\d{2})[- _](0[1-9]|1[0-2])[- _](0[1-9]|[12]\d|3[01])(?!\d)|(?<!\d)(?:(?:0[1-9]|[12]\d|3[01])[- _](?:0[1-9]|1[0-2])[- _](?:19|20)\d{2}|(?:0[1-9]|1[0-2])[- _](?:0[1-9]|[12]\d|3[01])[- _](?:19|20)\d{2})(?!\d)(*SKIP)(*FAIL)/g
Replace:
\1-\2-\3

DMY to YMD
Match:
(?<!\d)(?:19|20)\d{2}[- _](?:0[1-9]|1[0-2])[- _](?:0[1-9]|[12]\d|3[01])(?!\d)(*SKIP)(*F)|(?<!\d)(0[1-9]|[12]\d|3[01])[- _](0[1-9]|1[0-2])[- _]((?:19|20)\d{2})(?!\d)|(?<!\d)(?:0[1-9]|1[0-2])[- _](?:0[1-9]|[12]\d|3[01])[- _](?:19|20)\d{2}(?!\d)(*SKIP)(*FAIL)/g
Replace:
\3-\2-\1

MDY to YMD
Match:
(?<!\d)(?:19|20)\d{2}[- _](?:0[1-9]|1[0-2])[- _](?:0[1-9]|[12]\d|3[01])(?!\d)(*SKIP)(*F)|(?<!\d)(0[1-9]|1[0-2])[- _](0[1-9]|[12]\d|3[01])[- _]((?:19|20)\d{2})(?!\d)|(?<!\d)(?:0[1-9]|[12]\d|3[01])[- _](?:0[1-9]|1[0-2])[- _](?:19|20)\d{2}(?!\d)(*SKIP)(*FAIL)/g
Replace:
\3-\1-\2
TheGhost78
 
Posts: 277
Joined: Fri Jul 19, 2024 11:25 am


Return to Suggestions