Third parameter broken for the regexpreplace fn

@Florian, I had a spare 10mins to look into this as people were asking about the Traxsource scripts on my thread.

I think a bug has been introduced in the latest beta.

It's the third parameter here that I think is causing the issue. Removing it altogether and the scripts work but the function seems broken with the 3rd parameter.

These two lines are the issue in the scripts in the link that are on the Traxscourse Thread here.

regexpreplace "<a href=\"[^\"]+\" class=\"com-artists\" data-aid=\"([^\"]+)\">([^<]+)<\/a>" "<TrackArtistID=$1> <TrackArtistName=$2>" "<<endTrack>>"
regexpreplace "<span class=\"version\">([^<]+)<span class=\"duration\">\(([^\)]+)\)<\/span>" "<TrackMixName=$1><TrackLength=$2>" "<!--DIV artLinks-->"

Can you be a little bit more specific?

  1. Which of the various scripts in this package are you using?
  2. What are the search inputs to trigger the issue? And most importantly,
  3. What issues are you observing?

Sorry. Yes.

  1. All of them are broken because the same fn is in them all.
  2. Any search. It fails at the parsing album section as that's where the broken fns is.
  3. Nothing is getting output to the tags as the two lines of code are making it fail. Comment these out and the script continues to work but those lines are required in order for them to work.

Seems like I'm not lucky with testing those scripts and I've already spent an insane amount of time trying to reproduce this.

Using "Traxsource Release Search by Artist - title" with "Doug Gomez Puro" gives no results and using "Traxsource Track search by artist-title" with "Doug Gomez Puro" gives a valid result including title and cover art.

Please just share what you are using to produce the error.

There also is no 3rd parameter for RegexpReplace

From Developing Tag Sources – Mp3tag Documentation

Replaces everything that is matched by the regular expression in the first parameter by the string in the second parameter.

Sorry, I should've spotted that. In which case there's no bug with Mp3tag.

It's just that users were reporting them stopping to work with one of the latest betas.

See here:

So not sure how they even worked in the first place.

I've checked this further and I had a one-off error in validating the function parameters in web sources scripts, so that those would never be checked.

With the latest additions I needed to extend the maximum number of parameters per function from 3 to 5, so that the 3rd parameter was now checked too. We also had this before in our conversation via PM where the superfluous parameter for debug suddenly caused problems.

To make life easier for all of us, I've now extended validation and also added reporting of syntax errors via an error message with Mp3tag v3.21c.

1 Like

Thanks Florian. Sorry for sending you on a wild goose chase with this to begin with. I should've seen it was a RegexReplace fn and only 2 parameters should be there.