RegEx to Exchange Date Portions without Spaces?

Bulk Rename Utility How-To's

RegEx to Exchange Date Portions without Spaces?

Postby Brasa » Tue Apr 11, 2023 11:29 pm

Can someone please help me with some regular expression to change portions of a date that has no separation at all? I tried a lot of possibilities but nothing seems to work.

The files are like this:
Força de Um Desejo Capítulo de 31032023 Glbply-11456949.ts

where the pieces are:

Força de Um Desejo Capítulo de 31032023 Glbply-11456949.ts
Some title that varies in length [double space] "Capítulo de " DDMMYYYY [double space] etc

I need it to be:
The title "Capítulo de " YYYYMMDD (and the rest doesn't matter)
So in this example the final name should be "Força de Um Desejo Capítulo de 20230331"


Can someone please help?
Brasa
 
Posts: 2
Joined: Tue Apr 11, 2023 11:17 pm

Re: RegEx to Exchange Date Portions without Spaces?

Postby Admin » Wed Apr 12, 2023 3:14 am

Hi, try : with RegEx (1) , enable Simple, then

Match: %1[double space]%2[space]%3[double space]%4
Replace: %1[space]%2[space]%3
Admin
Site Admin
 
Posts: 2354
Joined: Tue Mar 08, 2005 8:39 pm

Re: RegEx to Exchange Date Portions without Spaces?

Postby Brasa » Thu Apr 13, 2023 1:55 pm

Admin wrote:Hi, try : with RegEx (1) , enable Simple, then

Match: %1[double space]%2[space]%3[double space]%4
Replace: %1[space]%2[space]%3



Thanks for the quick answer. The expression only removes the double spaces, but does not change the order of the dates... I have dates as DDMMYYYY (without any separator), and I need it to be YYYYMMDD.
Brasa
 
Posts: 2
Joined: Tue Apr 11, 2023 11:17 pm


Return to How-To