Insert text with a regular expression in the filename


Your filter did find the matches, perfectly. I then tried to apply what I have learned from your example, to try to add a dash after the first digit in the track number, located at the beginning of the file name. I used Action > "Replace with regular expression" for the renumbering, like this:


Regular expression: ^\d (tried this with and without parenthesis)

Replace matches with: d- (and various other combinations such as for e.g. ^\d-)(The first digit was correctly located, but was not correctly replaced with the correct number and the dash?)

The first digit was replaced and followed by the dash, all right, but with the letter "d" instead of the correct retained number. What am I doing wrong?

If you want to keep the number, then you have to tell MP3tag that it should remember it - which is done by enclosing the pattern in parenthesis.
So for something like
101. My music file
which should become
1-01. My music file
Search pattern: ^(\d)(.*)
Replace string: $1-$2

Further information about regular expressions can be found in the documentation:

Thank you, it did the job splendidly.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.