I have a lot of very long file names containing strings with random single digits between two hyphens, such as in dates. I would like to make changes universally where this occurs to add a zero between the first hyphen and the digit. Currently, I can only return this result if the rest of the name deletes. Anything I add to the Match Expression gives me the rest of the name, but not the desired zero.
But you will have to repeat it as many times as necessary if the filename has many single digits to replace.
"fdgfd-10-5-2014-gfd.txt" will be renamed to "fdgfd-10-05-2014-gfd.txt". "fdgfd-1-5-2014-gfd.txt" will be renamed to "fdgfd-1-05-2014-gfd.txt" the 1st time then to "fdgfd-01-05-2014-gfd.txt" the 2nd time.
Thank you for your response. It will be Dec 29 before I am back to work and can give this a try. It seems logical to me, so hopefully it will work just fine. I'll get back with a definite answer once I return.
Thank you TheRegExpMaster ! I tried your solution and it works just fine. That's a relief, being totally new to BRU and to Regular Expressions. I greatly appreciate your help.
heiserlon wrote:Thank you TheRegExpMaster ! I tried your solution and it works just fine. That's a relief, being totally new to BRU and to Regular Expressions. I greatly appreciate your help.