Reformat the date in file names

A swapping-ground for Regular Expression syntax

Re: Reformat the date in file names

Postby sandman85 » Mon Nov 04, 2019 6:40 pm

hi all, i have a similar issue but my file are named as follow

Type_DD-MM-YYYY_name

and i would like to rename

Type_YYYY-MM-DD_name

thanks for your help
sandman85
 
Posts: 1
Joined: Mon Nov 04, 2019 6:36 pm

Re: Reformat the date in file names

Postby therube » Mon Nov 04, 2019 7:12 pm

1:RegEx
Code: Select all
Match:  (.*?)_(\d\d)-(\d\d)-(\d\d\d\d)_(.*)
Replace:  \1_\3-\2-\4_\5

Match anything up to _, non-greedy
Match 2 digits
Match 2 digits
Match 4 digits
Match everything else

Rearrange
therube
 
Posts: 683
Joined: Mon Jan 18, 2016 6:23 pm

Previous

Return to Regular Expressions