Given a number files named like so:
2016_31_3_03_01c_02
2016_31_3_04_01a_02
2016_31_3_05_01d_02
I want to batch rename them so they read like
2016_31_3_3_1c_02
2016_31_3_4_1a_02
2016_31_3_5_1d_02
I could do rename 's/03_01c/3_1c/'
for every file but that would defeat the purpose of batching it.
How do I write the regex for rename
command to accomplish this?
Something like: rename 's/0{0..9}_01{a..d}/
but I don't know how to write the replace part without also replacing the leading zero after the underscore, which I want to keep.
I also don't really understand the regex to remove the leading zero but keep the digit following the leading zero the same. I know the regex to find those instances but not replace them.