Hi, I want to match filenames with the following possible patterns
Name.Date.Code.Junk.ext
Name.Code.Junk.ext
Where:
Name is anything (...)
Date is a 4 digit number (1)(1)(1)(1)
Code is a 4 digit number (1)(1)(1)(1)
Junk is anything (...)
I want to create a rule that will parse out the Name, Date, and Code and rename the file as follows
Name[.Date].Code.ext
So I created rule with the following custom patterns:
GreedyNameWithDateIfProvided = anything (...)
Code = 4 digit number (1)(1)(1)(1)
Junk = anything (...)
I then rename the file to
GreedyNameWithDateIfProvided.Code.ext
I was hoping that the first anything would be greedy and match as much as possible, but it doesn't seem to be. For files that look like Name.Date.Code.Junk.ext, GreedyNameWithDateIfProvided.Code.ext just matches the Name, and then the Code gets matched to the Date, and then the file gets renamed to Name.Date.ext without the Code.
I hope this all makes sense, and I hope there is a way to make my match be greedy.
Thanks.