change position from day to month using regex

A swapping-ground for Regular Expression syntax

change position from day to month using regex

Postby glennrune » Fri Jan 05, 2018 5:50 pm

Hello.

I want to change position from day to month using regex.
From 21.09.17 filename xxx
To 09.21.17 filename xxx

And is there a way to use regex to change year
xx.xx.17 to xx.xx.2017
glennrune
 
Posts: 7
Joined: Thu Dec 28, 2017 4:45 pm

Re: change position from day to month using regex

Postby therube » Fri Jan 05, 2018 9:39 pm

1:RegEx
Code: Select all
Match:  (\d\d).(\d\d).(\d\d)
Replace:  \2.\1.20\3

Oh, "filename xxx" is also part of it?
Then append, (.*) to match & \4 to replace.
Code: Select all
Match:  ^(\d\d).(\d\d).(\d\d)(.*)
Replace:  \2.\1.20\3\4
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm


Return to Regular Expressions