Wednesday, October 02, 2013

command line - How to use regex quantifiers to rename multiple files with zmv? - Super User

command line - How to use regex quantifiers to rename multiple files with zmv? - Super User: "This should work for you:

zmv '1-([0-9])( *)' '1-0$1$2'
or

zmv '1-([0-9])([^0-9]*)' '1-0$1$2'
You just need to make the match include only one digit followed by a space or non-digit. With the way you had it, it was matching one digit followed by anything."

'via Blog this'