File mass rename with RegEx

Hi there!

I would like to cut off the first 4 letters of file names using the dopus rename dialog for mass rename. For example I select files in the format

01. Metallica - For whom the bells tolls.mp3

and would like them to be named to

Metallica - For whom the bells tolls.mp3

I know this can be done somehow with regular expression but I do not have a glue about how this works.

Can anybody tell me what to put in the rename dialog to get this work?

Thanks, Wang

In RegEx rename mode, rename from b(.*)[/b] to \2

If you want to make it a bit better, so it will work with any number of digits followed by a dot and a space, and so it won't accidentally strip 4 characters off a filename that doesn't start with any digits, then you can use something like this:

From b(.*)[/b] to \2

Thanks 8 million times!

...one more thing:

I would like to put this behind a button. Somehow it's not working (I know I'm doing something wrong :unamused:). I placed following line in the function box of the button:

Rename FROM REGEXP ([0-9]+.)(.*) TO REGEXP \2

When I click the button nothing happens. Any idea what's missing?

Thanks!

Try changing your button command to this:

Rename PATTERN "([0-9]+)(.*)" TO "\2" REGEXP

Thanks a lot John,

it looks nearly good. Had to add . to your line but anyway it leaves a blank in front of the file name.

Using

Rename PATTERN "([0-9]+.)(.*)" TO "\2" REGEXP

renames

"01. Metallica - For whom the bells tolls.mp3"

to

" 01. Metallica - For whom the bells tolls.mp3"

(notice the blank as first char).

Any ideas?

Okay, got it! Forgot the blank in the expression.

Rename PATTERN "([0-9]+. )(.*)" TO "\2" REGEXP

does the job.

Thanks again!