Insert tag fields inside another tag field

Hi Guys

Just joined and are very new to this scripting thing.

All my tracks have the fields %album%, %year%, %release date%.

%year% is the year when an artist released a certain album for the very first time

%release date% is the year when a particular release of that album was released (and may differ from %year% or not.

Actually all %album% fileds are tagged like this:

year - album_name [releasedate] (label, code, country)

1970 - Deep Purple In Rock [2009] (Audio Fidelity, AFZ 051, US)

I want to change album fileds in the following way:

album_name [year - releasedate] (label, code, country)

Deep Purple In Rock [1970 - 2009] (Audio Fidelity, AFZ 051, US)

If possible best would be comparing year to release date and insert just one date when they are equal:

2013 - Now What [2013] (VIZP-116, SHM-CD, Japan)
should become
Now What [2013] (VIZP-116, SHM-CD, Japan)

Thank you in advance to anyone who will try to help !

What have you tried so far?

I found this solution:

Fill Year-ReleaseYear.mta (293 Bytes)

I think you could modify action #2 to
Repace string:2='$1$2'%year-relase%'$4$5'
so that you do not need action #3

I had tried to do that but for some reason it doesn't work. Maybe I don't write the syntax correctly ?

The content of field %year-releaseyear" is not read inside "replace with regular expression" action while it's read in replace action !

please note the various apostrophes that are surround %year-release%.
You can test the regular expression with $regexp() in the function Convert>Tag-Tag

For some reasons $regexp only works if I write it this way (tested in Convert>Tag-Tag):

$regexp(%album%,'(.)([)(.+?)(])(.)', $1$2 %year-releaseyear%$4$5)

and I have to put a space between $2 and %year-releaseyear% but I end up having a space between "[" and the year that I don't want