Add Date Month Year from Discogs


I want to add the Released date (21 Mar 2008) from Discogs to the tag.
But i do not understand the regex script from mp3tag 2.41.

I tryed to Search for the Date and want to Format it.
21 Mar 2008

my Script:

^(?<Day>(31(?! (Feb|Apr|Jun|Sep|Nov)))|((30|29)(?! Feb))|(29(?= Feb(((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00)))))|(0?[1-9])|1\d|2[0-8]) (?<Month>Jan|Feb|Mar|May|Apr|Jul|Jun|Aug|Oct|Sep|Nov|Dec) (?<Year>(1[6-9]|[2-9]\d)\d{2})$

RegEx Replacement:

$& [${Year}-${Month}-${Day}]


In mp3 tag i get following error:

Invalid preceding regular expression22

I have Checked this Regex online. And it works, but not in mp3tag.
(Later i want to rewrite it in YYYY-MM-DD) (2008-03-26)

My Question: What is the error? or can i bypass this regex?

Big thx for any reply. :wink: And sorry 4 my english, but my german is better. :wink:

There are some special characters in Mp3tag, which have to be escaped when using Mp3tag regex abilities, e. g. [ should become '['. There might be other syntax specials too, which prevent you from running your fine composed regex string.

Try this instead:

$replace($regexp('21 Mar 2008',^(\d{1,2}) (.+?) (\d{4})$,$3-$2-$1),


Hi DetlevD,

thank you for your answer. I understand your sting and I tried to repace my string with yours, but i have the same problem.

Invalid preceding regular expression22

Can you give me an little code example?

Well, my example is an example par excellence, which will create valid output by itself.
You may try to run an action 'tagfield format' against a sample track using fieldname 'test' and as formatstring the complete example string from above. The result should be: new tagfield 'TEST' containing string value '2008-03-21'.

Try to reduce your erroneous regular expression to a minimalistic format, use some simple basic regex rule and see what happens. If the result is ok, then try a more advanced regex rule, ..., and so on, until you've catched the problem. Make sure that you use the appropriate regex syntax for Mp3tag.