# How to remove parenthesis (with a certain condition)

**URL:** https://community.mp3tag.de/t/how-to-remove-parenthesis-with-a-certain-condition/9338
**Category:** Support
**Created:** [November 14, 2009, 9:31pm UTC](https://community.mp3tag.de/t/how-to-remove-parenthesis-with-a-certain-condition/9338 "2009-11-14T21:31:10Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![rhannie8](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/b9e5f3/32.png) [@rhannie8](https://community.mp3tag.de/u/rhannie8)
#### Post date: [November 14, 2009, 9:31pm UTC](https://community.mp3tag.de/t/how-to-remove-parenthesis-with-a-certain-condition/9338/1 "2009-11-14T21:31:10Z")

</div>

I have some songs where the title contains "(feat. Random Artists)" but I'd like for it to simply say "feat. Random Artists". I know how to make the symbol in "(feat." disappear, but I don't know to have the last ")" disappear without also having every ")" in the title disappear, like if I had something like "(Remix)" in the title. I hope my question makes sense...

---

<div class="post-metadata">

### Author: ![Quaraxkad](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/q/7bcc69/32.png) [@Quaraxkad](https://community.mp3tag.de/u/Quaraxkad)
#### Post date: [November 15, 2009, 5:16am UTC](https://community.mp3tag.de/t/how-to-remove-parenthesis-with-a-certain-condition/9338/2 "2009-11-15T05:16:14Z")

</div>

Are you familiar with RegEx? You can create a custom Action using "Replace with regular expressions", that would allow you to do what you're asking. Replace _((feat[^)]\*))_ with _$1_, that should remove the parenthesis from anything that matches _(feat whatever)_, but not from _(whatever)_. That will include (feat. whatever) and (featuring whatever). You may want to try that on some test files first, I know Regex but I'm no expert.

---

<div class="post-metadata">

### Author: ![rhannie8](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/b9e5f3/32.png) [@rhannie8](https://community.mp3tag.de/u/rhannie8)
#### Post date: [November 17, 2009, 2:39am UTC](https://community.mp3tag.de/t/how-to-remove-parenthesis-with-a-certain-condition/9338/3 "2009-11-17T02:39:51Z")

</div>

> [@Quaraxkad](#):
>
> Are you familiar with RegEx? You can create a custom Action using "Replace with regular expressions", that would allow you to do what you're asking. Replace _((feat[^)]\*))_ with _$1_, that should remove the parenthesis from anything that matches _(feat whatever)_, but not from _(whatever)_. That will include (feat. whatever) and (featuring whatever). You may want to try that on some test files first, I know Regex but I'm no expert.

EXCELLENT! Thank you so much! I wish I were more familiar with RegEx. ☹

---

<div class="post-metadata">

### Author: ![confidential](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/ecb155/32.png) [@confidential](https://community.mp3tag.de/u/confidential)
#### Post date: [June 6, 2011, 8:50pm UTC](https://community.mp3tag.de/t/how-to-remove-parenthesis-with-a-certain-condition/9338/4 "2011-06-06T20:50:00Z")

</div>

i know this topic is old, but i've got some issues.

my problem is, that in some featurings i got some inner parentheses. just an example for an artist: wyclef jean (feat. dwayne (the rock) johnson)...

my problem now is, that when i want to remove the parentheses, it will be: wyclef jean feat. dwayne (the rock johnson)... so how can i make this function always picks the last parenthese to remove? i never havea nything written behind the featurings, so the script should just go until the last parenthese ")"... thanks already now

greetings

---

<div class="post-metadata">

### Author: ![Quaraxkad](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/q/7bcc69/32.png) [@Quaraxkad](https://community.mp3tag.de/u/Quaraxkad)
#### Post date: [June 6, 2011, 10:55pm UTC](https://community.mp3tag.de/t/how-to-remove-parenthesis-with-a-certain-condition/9338/5 "2011-06-06T22:55:46Z")

</div>

RegEx is incapable of matching the ending parenthesis of a nested group, _but_ if you're certain that in **every** tag the ending parenthesis will be the last character in the field, use this in place of the RegEx string mentioned above: (feat.\*

This will match anything and everything after (feat

---

<div class="post-metadata">

### Author: ![confidential](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/ecb155/32.png) [@confidential](https://community.mp3tag.de/u/confidential)
#### Post date: [June 7, 2011, 6:17am UTC](https://community.mp3tag.de/t/how-to-remove-parenthesis-with-a-certain-condition/9338/6 "2011-06-07T06:17:24Z")

</div>

thanks for your answer. .)

but now, i have the problem, that the featurings are just erased, and not just the paranthesis are removed...  
in the "replace matched field with", i still have $1.

don't i have to change something there too?

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [June 7, 2011, 7:05am UTC](https://community.mp3tag.de/t/how-to-remove-parenthesis-with-a-certain-condition/9338/7 "2011-06-07T07:05:14Z")

</div>

> [@confidential](#):
>
> ... i have the problem, that the featurings are just erased, and not just the paranthesis are removed...  
> in the "replace matched field with", i still have $1.  
> don't i have to change something there too?

Set Mp3tag Filter:

**ARTIST MATCHES "^.+?\(feat.+?(\(.+?\))?.+?\)$"**

Action: Format value  
Field: ARTIST  
Formatstring:

**$regexp(%ARTIST%,'^(.+?)\((.+?)\)$','$1$2')**

From:  
**wyclef jean (feat. dwayne (the rock) johnson)**  
**wyclef jean (feat. dwayne johnson)**  
To:  
**wyclef jean feat. dwayne (the rock) johnson**  
**wyclef jean feat. dwayne johnson**

DD.20110607.1107.CEST

---

<div class="post-metadata">

### Author: ![confidential](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/ecb155/32.png) [@confidential](https://community.mp3tag.de/u/confidential)
#### Post date: [June 7, 2011, 7:42am UTC](https://community.mp3tag.de/t/how-to-remove-parenthesis-with-a-certain-condition/9338/8 "2011-06-07T07:42:42Z")

</div>

perfect!

thank you very!

---

<div class="post-metadata">

### Author: ![pone](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pone/32/272_2.png) [@pone](https://community.mp3tag.de/u/pone)
#### Post date: [June 7, 2011, 7:53am UTC](https://community.mp3tag.de/t/how-to-remove-parenthesis-with-a-certain-condition/9338/9 "2011-06-07T07:53:16Z")

</div>

filter is not necessary.

Action: Format Value  
Field: ARTIST  
Formatstring: **$regexp(%artist%,'((|[)(ft|feat|featuring).?(.+)()|])',feat.$3,1)**

works for round an and square parentheses.  
works for ft, feat, and featuring, with or without dot and written with small or large letters.  
replaces all ft/feat/featuring spellings into "feat.".  
erases always the first and the last parenthesis.

---

<div class="post-metadata">

### Author: ![confidential](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/ecb155/32.png) [@confidential](https://community.mp3tag.de/u/confidential)
#### Post date: [June 7, 2011, 8:16am UTC](https://community.mp3tag.de/t/how-to-remove-parenthesis-with-a-certain-condition/9338/10 "2011-06-07T08:16:45Z")

</div>

even better. 😃

now i have another problem. i know it's the wrong thread but i don't know if it's worth starting a new thread. have a lot of titles in a way like that:

l'enfer (& east, fabe & rahzel) - iam

how can i change it to:  
l'enfer - iam, east, fabe & rahzel

because i always just really want the tilte in the title field, and the artists in the artist field. because of the "album artist" field, this isn't a problem anymore. 🙂  
for the featurings, i already did it with a function of this forum. but how can i make it for the '&'?

---

<div class="post-metadata">

### Author: ![pone](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pone/32/272_2.png) [@pone](https://community.mp3tag.de/u/pone)
#### Post date: [June 7, 2011, 8:43am UTC](https://community.mp3tag.de/t/how-to-remove-parenthesis-with-a-certain-condition/9338/11 "2011-06-07T08:43:51Z")

</div>

> [@confidential](#):
>
> even better. 😃
> 
> now i have another problem. i know it's the wrong thread but i don't know if it's worth starting a new thread. have a lot of titles in a way like that:
> 
> l'enfer (& east, fabe & rahzel) - iam
> 
> how can i change it to:  
> l'enfer - iam, east, fabe & rahzel
> 
> because i always just really want the tilte in the title field, and the artists in the artist field. because of the "album artist" field, this isn't a problem anymore. 🙂  
> for the featurings, i already did it with a function of this forum. but how can i make it for the '&'?

try this:

Action: Guess Values  
Source format: **%artist% $regexp(%title%,'(.+) ((|[)((?:featuring|feat|ft|&|and|with|vs).? .+)()|])',$3+++$1,1)**  
 Guessing pattern: **%artist%+++%title%**

I have expanded the list a bit (&, and, with, vs). You just have to check that the additional words are not a real part of the title.  
Tiltes like:  
_I love you (and me)  
I'm sick (with love)_  
would make problems.

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [June 7, 2011, 8:48am UTC](https://community.mp3tag.de/t/how-to-remove-parenthesis-with-a-certain-condition/9338/12 "2011-06-07T08:48:23Z")

</div>

> [@pone](#):
>
> filter is not necessary. ...

Yes, not necessary, but safe ... and makes the regular expression simple.

Yes, pone's expression works for almost all cases and has been stored already in my database.

I did a small modification, so the replacement of the 'featuring' derivatives works even without enclosing brackets, but leave extra brackets in the middle.

**$regexp(%TITLE%,'[([]?(?:ft|feat|featuring)\.?\s+(.+)[)]]?\s\*','feat. $1',1)**

From:  
wyclef jean featuring dwayne (the rock) johnson  
wyclef jean (feat. dwayne (the rock) johnson)  
wyclef jean ft. dwayne the rock johnson  
wyclef jean with dwayne the rock johnson

To:  
wyclef jean feat. dwayne (the rock) johnson  
wyclef jean feat. dwayne (the rock) johnson  
wyclef jean feat. dwayne the rock johnson  
wyclef jean with dwayne the rock johnson

DD.20110607.1247.CEST

---

<div class="post-metadata">

### Author: ![confidential](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/ecb155/32.png) [@confidential](https://community.mp3tag.de/u/confidential)
#### Post date: [June 7, 2011, 9:54am UTC](https://community.mp3tag.de/t/how-to-remove-parenthesis-with-a-certain-condition/9338/13 "2011-06-07T09:54:09Z")

</div>

thanks detlev

> [@pone](#):
>
> try this:
> 
> Action: Guess Values  
> Source format: **%artist% $regexp(%title%,'(.+) ((|[)((?:featuring|feat|ft|&|and|with|vs).? .+)()|])',$3+++$1,1)**  
> Guessing pattern: **%artist%+++%title%**
> 
> I have expanded the list a bit (&, and, with, vs). You just have to check that the additional words are not a real part of the title.  
> Tiltes like:  
> _I love you (and me)  
> I'm sick (with love)_  
> would make problems.

this almost works, but for now, the new artist is formed that way:

joe morton & sharon riley, the faith chorale, taj mahal & sam moore

this means, the first ' &' should be replaced by a ',' if there are more than 2 artists in total. but i have no idea how to implement this in the code. 😕

does anyone have some tips?

---

<div class="post-metadata">

### Author: ![pone](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pone/32/272_2.png) [@pone](https://community.mp3tag.de/u/pone)
#### Post date: [June 7, 2011, 12:11pm UTC](https://community.mp3tag.de/t/how-to-remove-parenthesis-with-a-certain-condition/9338/14 "2011-06-07T12:11:23Z")

</div>

my string above keeps these words/symbols as found in the title: **featuring|feat|ft|&|and|with|vs**

you can change that to the following:

Action: Guess Values  
Source format: **%artist%$regexp(%title%,'(.+) ((|[)(?:featuring|feat|ft|&|and|with|vs).? (.+)()|])',', $3+++$1',1)**  
 Guessing pattern: **%artist%+++%title%**

Now, everyone of the words is replaced by a comma. Note that you need addtional 'single quotationmarks' if you need a comma as literal character

But if you want this replacement only for more than two artists it gets more complicated to make it automatic.  
You could make another $regexp function around the whole thing, which replaces the first "&" or "and" when another "&" or "and" follows.:

Action: Guess Values  
Source format: **$regexp(****%artist%$regexp(%title%,'(.+) ((|[)((?:featuring|feat|ft|&|and|with|vs).? .+)()|])',$3+++$1,1)****,(&|and)(.+)(&|and)(.++++.+),',$2$3$4')**  
 Guessing pattern: **%artist%+++%title%**

---

<div class="post-metadata">

### Author: ![confidential](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/ecb155/32.png) [@confidential](https://community.mp3tag.de/u/confidential)
#### Post date: [June 7, 2011, 12:21pm UTC](https://community.mp3tag.de/t/how-to-remove-parenthesis-with-a-certain-condition/9338/15 "2011-06-07T12:21:05Z")

</div>

wow, you're awesome. it works correctly now. thank you very for your time and help.

good afternoon  
greetz

---

<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: [February 9, 2026, 12:21pm UTC](https://community.mp3tag.de/t/how-to-remove-parenthesis-with-a-certain-condition/9338/16 "2026-02-09T12:21:56Z")

</div>


