Page 1 of 1

Regex-Rename with backreferences

Posted: 05 Aug 2019 09:32
by rclkrtrzckr
Hi all

I have a bunch of files with a similar filename:

19-05-01_onetwothree.pdf
19-06-02_anotherone.pdf

The first 6 characters are the date these files were created (I get them from my insurance that way). Now I'd like to rename them to match my file naming conventions (YYYYMMDD_....). On a unix system, I would probably do something like this (untested):

Code: Select all

s/^([0-9]{2})-([0-9]{2})-([0-9]{2})_/20\1\2\3_/
Is there a way to do this in XYplorer? In the help, there's only one example, where the regex is used to match the files to be renamed.

Thanks in advance

André

Re: Regex-Rename with backreferences

Posted: 05 Aug 2019 10:23
by highend
As long as you only have those files (that need to be renamed) selected,
right click them, "Rename Special" - "RegExp Rename..."

^(.) > 20$1

Re: Regex-Rename with backreferences

Posted: 05 Aug 2019 13:52
by rclkrtrzckr
highend wrote: 05 Aug 2019 10:23 As long as you only have those files (that need to be renamed) selected,
right click them, "Rename Special" - "RegExp Rename..."

^(.) > 20$1
Awesome, thanks!