Regular expressions only work once


I am trying to use the following regular expressions to remove the first 5 characters of all track titles that I have for an album.

  1. ^.*?\d\s
    & 2) $cutleft(%title%,5)

To test I selected track 1 and applied my action which worked exactly as expected. So I thought I could now do the remaining 20 tracks with confidence that my regular expression was correct, I then selected all of the remaining tracks and again applied the action however nothing happened, worse my expression has ceased to work at all!
I thought maybe you cannot apply a regular expression to multiple selections so this time selected only one track but no it again did not work.

I then closed MP3TAG and reopened and again selected one track and applied the action but it still does not work.

I have tried other regular expressions that work as described above and they work as expected but as soon as I select multiple tracks and apply the expressions they too stop working.

Why is this?

This is very hard to say as you neither show us the original data nor the regular expression.
Also, you don't say what "does not work" mean for you.

Hi ohrenkino,

My apologies I clean forgot to paste that detail before I created the topic.

I have edited my post above.

Action of the type "Format value" for TITLE
Format string: $regexp(%title%,^\d+ - ,)
You can test that expression in Convert>Tag-Tag

The number of files selected does not affect the execution of regular expressions or scripting functions.
You might have misinterpreted what is happening.
Also, $cutleft(%title%,5) is a scripting function, not a regular expression.
It is all you need to remove the first 5 characters of all track titles.
A regex could be used for your specific title structure (as shown above), but is not necessary.

Hi ryerman, thanks for the response, you are right I had not understood that I was trying to use a scripting function as a regular expression. Strange though that it worked just the once. However the regular expression that I did use "^.*?\d\s " also only worked just the once.

I have now used the string function "$cutleft(%title%,5)" on multiple selections successfully by inserting it into Convert>Tag-Tag.

Many thanks

Hi ohrenkino,

I tried "$regexp(%title%,^\d+ - ,)" as you suggested and it worked on multiple selections.

Many thanks for your help.

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