Page 1 of 1

how to use regex to rename my files

PostPosted: Wed May 15, 2019 2:48 pm
by danmcg
so i have the following file that i need renamed, but don't know how to use the program (the rename button is greyed out). how do i put in a req ex code and how do i get the rename button to not be greyed out

here is a sample of the file name
Check Request 010918-01 ChrisLapiMoving.xlsm
and it needs to be renamed to
Check Request 180109-01 ChrisLapiMoving.xlsm

any help would be appreciated

Re: how to use regex to rename my files

PostPosted: Wed May 15, 2019 7:56 pm
by therube
1:RegEx
Code: Select all
Match:  (.*?)(\d\d)(\d\d)(\d\d)(-\d\d.*)
Replace:  \1\4\3\2\5



(While that looks to work, there seems to be a difference - in other applications [like Everything], between:

Code: Select all
(.*? )(\d\d)(\d\d)(\d\d)(-\d\d.*)
(.*?) (\d\d)(\d\d)(\d\d)(-\d\d.*)
(.*?)(\d\d)(\d\d)(\d\d)(-\d\d.*)
and
(.*?)(\d\d)(\d\d)(\d\d)(-\d\d.*)

and I'm not sure why?
In Everything, the latter finds your filenames, but the former (two that are different) do not?

Re: how to use regex to rename my files

PostPosted: Thu May 16, 2019 12:31 pm
by danmcg
thanks for the reply but in my "new name" listbox, it's naming it as YYDDMM and i wanted it YYMMDD. can you repost?

old name "Check Request 032417-01 Classic Brass Works"

new name "Check Request 170324-01 Classic Brass Works"

thanks for the help

Re: how to use regex to rename my files

PostPosted: Thu May 16, 2019 12:38 pm
by danmcg
nevermind, i figured it out.

did replace with "\1\4\2\3\5"