Until a few years ago I labelled dates on my Files in the YYYYMMDD formate (eg todays date, the 15. September 2021 would be 20210915). I would like to change that to YYMMDD (210915).
With the Change Name function, is there a way to tell DT to only delete the first two digits off a file name? Thanks in advance!
Just curious why you’re dropping the century
I use the same naming standard; prefixing the name with the subject date
and I have many dates preceding 2000
(and learned the lesson from Y2K )
Your solution of course works, but I’d suggest a sligthly simpler RE: ^\d{2}(\d{6}.*)
There’s no reason to use a zero-width look-ahead pattern here <(?=\d{8})>. You want 8 digits at the start of the name. Since you are going to ignore the first two <\d{2}>, look for 6 more digits <\d{6}> and grab those together with the rest in a capturing group <(\d{6}.*)>.
REs are complicated enough as they are, it is worthwile keeping them as simple as possible. That makes them easier to understand and manage. Also, it reduces the awe factor and might help people to get onto a less steep learning curve with them.