can someone please edit %:s/\([0-9]*\)_\(*\)/\2 so that i can rename files. for example, if file name is 5555_word_word.jpg, then I want the file name to be word_word.jpg. i feel like I am so close!
can someone please edit %:s/\([0-9]*\)_\(*\)/\2 so that i can rename files. for example, if
Share
Try this:
The
.will match any character (part of the second grouping) and the*will greedily match any amount of them. Your original regex was missing that directive. This will also rename files of the form_word_word.txttoword_word.txt. If you want to require digits to match (probably a good idea), use:The
\+directive means to match 1 or more instances.