I've got a method for changing date formats that works well enough, but am looking for a slight improvement.
I am using BRU to change the date format in hundreds of thousands of old folder names and file names to the ISO standard date format: YYYY-MM-DD. The current date format in my case is YYYY.MM.DD. Searching through existing posts on this board I've found a regular expression that works almost perfectly:
Match: (.*)(\d{4})\.(\d{2})\.(\d{2})(.*)
Replace: \1\2-\3-\4\5
I found only 2 limitations:
1) It changes only 1 date in each name, whoever simply running it twice handles up to 2 dates per name, which worked fine for me.
2) More seriously, there were cases where there were strings within file names that had the format 9999.99.99 that weren't in fact dates.
The 2nd shortcoming would be fixed if the regular expression looked only for the initial year string to start with "20". Can anyone tell me how I might tweak the regular expression above to accomplish this?