I have a number of files in this format:
##.## - File name.mp4
I want to rename them to:
s##e##.mp4
This is what I came up with:
rename -n "s/^(\d{2})\.(\d{2}).*/s$1e$2.mp4/"
It works when I tested it on http://regexr.com/ but when I run the command on my Ubuntu 12.04 installation all my files get renamed to se.mp4
So it looks like the groups are being ignored or not inserted or something along those lines. Am I missing something blindingly obvious or is something else going on?
I ended up using pyRenamer and that worked wonderfully, but I would still like to know why rename
isn't working properly.
Cheers and thanks for any help you can give me.