[Solved] Extracting Text from Title Tag and Reformatting Album Tag

Hello mp3tag community,

I'm struggling to find an elegant action/regular expression solution to extracting certain text from the title tag and reformatting my already existing album tag. Here is the scenario:

100s of songs in this format - tags
Title: (Name of Riddim) Song Title Here
Artist: Groovy Greg
Album: 2020C - GRV

What I'd like to achieve
Title: Song Title Here
Artist: Groovg Greg
Album: Name of Riddim - 2020C - GRV

So dismantling the title tag to extract "(Name of Riddim)" then removing the brackets and appending "Name of Riddim" to the album tag as shown above.

You could try an action of the type "Guess value"
Source: $regexp(%title%,\((.*)\) (.*),$2 == $1) - %album%
Format string: %title% == %album%

Thank you @ohrenkino! You saved my day :slight_smile:

I tried adding ^ to the start of the express to see if I could get it to stop after the first set of brackets. This method does work well, providing I use my other action to remove "(Soca 2020)" first. So this is still good however just trying to further optimize my workflow.

To treat the greadiness, use a ?
So it could be that the following works better:
Source: $regexp(%title%,\((.*?)\) (.*),$2 == $1) - %album%

If you have trouble, show the real example string

Ah I see. Yes, this is the ultimate solution. Thank you very much.



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