Exrpession to clean up dates

Advanced Renamer forum
#1 : 04/03-14 03:04
binar
binar
Posts: 2
Fellow Forum Members,

I need help with writing an expression that will do the following:

2009 . 01 . 16 . Georgia

Change to :

2009.01.16 Georgia

I tried:

/d . /d

but it does not work because the "period" character conflicts with the expression itself.

Any help will be appreciated.


04/03-14 03:04
#2 : 06/03-14 08:41
Stefan
Stefan
Posts: 274
Reply to #1:

You want to do two things together: replace space-period-space between digits only AND between digits and char.
So I would do this in two steps with two Replace Methods:

1.) Replace "space period space" by an period

Replace Method
Find : " \. "
Replace: "."
Occ : All
[X] RegEx

Result:
2009.01.16.Georgia


2.) Replace "period followed by an non-Digit" by that non-Digit sign

Replace Method
Find : "\.(\D)"
Replace: ".$1"
Occ : All
[X] RegEx

Result:
2009.01.16 Georgia

.

.


06/03-14 08:41