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

**URL:** <https://community.mp3tag.de/t/solved-extracting-text-from-title-tag-and-reformatting-album-tag/48245>\
**Category:** Support\
**Created:** [March 23, 2020, 11:55am UTC](https://community.mp3tag.de/t/solved-extracting-text-from-title-tag-and-reformatting-album-tag/48245 "2020-03-23T11:55:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lex](https://community.mp3tag.de/user_avatar/community.mp3tag.de/lex/32/7402_2.png) [@Lex](https://community.mp3tag.de/u/Lex)\
**Post date:** [March 23, 2020, 11:55am UTC](https://community.mp3tag.de/t/solved-extracting-text-from-title-tag-and-reformatting-album-tag/48245/1 "2020-03-23T11:55:34Z")

</div>

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.

 ![Screen Shot 2020-03-23 at 5.54.26 AM](https://community.mp3tag.de/uploads/default/original/2X/0/09b4507fcbabfc8bb163b8a9df6a33fbf94338ea.png)

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [March 23, 2020, 12:11pm UTC](https://community.mp3tag.de/t/solved-extracting-text-from-title-tag-and-reformatting-album-tag/48245/2 "2020-03-23T12:11:12Z")

</div>

> [@Lex](#):
>
> (Name of Riddim) Song Title Here

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

---

<div class="post-metadata">

**Author:** ![Lex](https://community.mp3tag.de/user_avatar/community.mp3tag.de/lex/32/7402_2.png) [@Lex](https://community.mp3tag.de/u/Lex)\
**Post date:** [March 23, 2020, 12:37pm UTC](https://community.mp3tag.de/t/solved-extracting-text-from-title-tag-and-reformatting-album-tag/48245/3 "2020-03-23T12:37:42Z")

</div>

Thank you @ohrenkino! You saved my day 🙂

---

<div class="post-metadata">

**Author:** ![Lex](https://community.mp3tag.de/user_avatar/community.mp3tag.de/lex/32/7402_2.png) [@Lex](https://community.mp3tag.de/u/Lex)\
**Post date:** [March 23, 2020, 12:52pm UTC](https://community.mp3tag.de/t/solved-extracting-text-from-title-tag-and-reformatting-album-tag/48245/4 "2020-03-23T12:52:18Z")

</div>

> [@ohrenkino](#):
>
> $regexp(%title%,((._)) (._),$2 == $1) - %album%

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.

---

<div class="post-metadata">

**Author:** ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)\
**Post date:** [March 23, 2020, 12:55pm UTC](https://community.mp3tag.de/t/solved-extracting-text-from-title-tag-and-reformatting-album-tag/48245/5 "2020-03-23T12:55:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Lex](https://community.mp3tag.de/user_avatar/community.mp3tag.de/lex/32/7402_2.png) [@Lex](https://community.mp3tag.de/u/Lex)\
**Post date:** [March 23, 2020, 1:25pm UTC](https://community.mp3tag.de/t/solved-extracting-text-from-title-tag-and-reformatting-album-tag/48245/6 "2020-03-23T13:25:47Z")

</div>

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

Before

 ![Screen Shot 2020-03-23 at 7.26.14 AM](https://community.mp3tag.de/uploads/default/original/2X/0/0baedf8900c333a3cd65731b3c082c91f4ac4b6f.png)

After

 ![Screen Shot 2020-03-23 at 7.26.37 AM](https://community.mp3tag.de/uploads/default/original/2X/7/71bb0bce887f5f9ec74f4df0215cb69daae0bcce.png)

---

<div class="post-metadata">

**Author:** ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)\
**Post date:** [April 22, 2020, 1:25pm UTC](https://community.mp3tag.de/t/solved-extracting-text-from-title-tag-and-reformatting-album-tag/48245/7 "2020-04-22T13:25:54Z")

</div>

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