You are not logged in.
Pages: 1
I need help setting up a RegExp.
I have a couple of files which contain a date pattern (no day):
yyyy mm
or
yyyy.mm
I want to put now month BEFORE year part:
mm.yyyy
In target pattern there should be in all cases a dot between mm and yyyy
regardless whether there was a dot in source pattern or not.
How can I write such a RegExp?
Thank you
Peter
Offline
I need help setting up a RegExp.
I have a couple of files which contain a date pattern (no day):
yyyy mm
or
yyyy.mmI want to put now month BEFORE year part:
mm.yyyy
In target pattern there should be in all cases a dot between mm and yyyy
regardless whether there was a dot in source pattern or not.How can I write such a RegExp?
Thank you
Peter
Depends on the rest of the original name. Are this the only digits in all files?
Well, perhaps we have luck and it works as we will match 4digits/2digits in an row.
FROM:
Any signs YYYY.MM Any signs
TO:
Any signs MM.YYYY Any signs
DO:
Match all signs: (.+) and store in group 1
Match four digits: (\d\d\d\d) and store in group 2
Match an space or an dot: (\s|\.) and store in group 3
Match two digits: (\d\d) and store in group 4
Match all signs: (.+) and store in group 5
So search for: (.+) (\d\d\d\d)(\s|\.)(\d\d) (.+) adding needed space or not between groups yourself.
Replace as you need: $1 $4.$2 $5 adding needed space or dot between groups yourself.
HTH?
Read the *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)
Offline
works :-)
Offline
Pages: 1