# Fixing multiple 'feat.' in the artist field

**URL:** https://community.mp3tag.de/t/fixing-multiple-feat-in-the-artist-field/63532
**Category:** Support
**Created:** [January 23, 2024, 9:46am UTC](https://community.mp3tag.de/t/fixing-multiple-feat-in-the-artist-field/63532 "2024-01-23T09:46:27Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Dan10305](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/a88e57/32.png) [@Dan10305](https://community.mp3tag.de/u/Dan10305)
#### Post date: [January 23, 2024, 9:46am UTC](https://community.mp3tag.de/t/fixing-multiple-feat-in-the-artist-field/63532/1 "2024-01-23T09:46:27Z")

</div>

Hi all,  
I've made a bit of a mess of my library and I'm trying to fix it but have long since hit the limit of my ability with regex.

My artist fields all look something like this:  
Westside Gunn feat. Busta Rhymes feat. Raekwon feat. Ghostface Killah feat. Stove God Cooks

What I'm trying to get to is something like:  
Westside Gunn feat. Busta Rhymes, Raekwon, Ghostface Killah & Stove God Cooks....or  
Westside Gunn feat. Busta Rhymes, Raekwon, Ghostface Killah, Stove God Cooks would be fine too.

Does anyone have any suggestions as to how I can deal with these extra 'feat.' values?

Thanks all

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [January 23, 2024, 9:50am UTC](https://community.mp3tag.de/t/fixing-multiple-feat-in-the-artist-field/63532/2 "2024-01-23T09:50:45Z")

</div>

> [@Dan10305](#):
>
> Westside Gunn feat. Busta Rhymes, Raekwon, Ghostface Killah & Stove God Cooks

I don't see how a regular expression could guess that in this case the "` feat.` " should be replaced  
with "` &` "  
For the other cases, you want to replace all the "` feat.` " with a comma and a space, but not the first occurrence of "` feat.` ", right?

---

<div class="post-metadata">

### Author: ![Dan10305](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/a88e57/32.png) [@Dan10305](https://community.mp3tag.de/u/Dan10305)
#### Post date: [January 23, 2024, 10:20am UTC](https://community.mp3tag.de/t/fixing-multiple-feat-in-the-artist-field/63532/5 "2024-01-23T10:20:24Z")

</div>

I thought getting the last one as '&' was a step too far but yes, all but the first 'feat.' as a comma and space would be fantastic if possible

---

<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: [January 23, 2024, 10:22am UTC](https://community.mp3tag.de/t/fixing-multiple-feat-in-the-artist-field/63532/6 "2024-01-23T10:22:55Z")

</div>

Try an action of the type "Format value" for ARTIST  
Format string: `$replace($regexp($replace($regexp(%artist%,(.*?) feat\. (.*),$1==$2), feat.,','),'(.*), (.*)',$1 & $2),==, feat. )`

From  
Westside Gunn feat. Busta Rhymes feat. Raekwon feat. Ghostface Killah feat. Stove God Cooks  
to:  
"Westside Gunn feat. Busta Rhymes, Raekwon, Ghostface Killah & Stove God Cooks

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [January 23, 2024, 10:27am UTC](https://community.mp3tag.de/t/fixing-multiple-feat-in-the-artist-field/63532/7 "2024-01-23T10:27:33Z")

</div>

Would you mind to tell us in a short explanation how this works? 😉

---

<div class="post-metadata">

### Author: ![Dan10305](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/a88e57/32.png) [@Dan10305](https://community.mp3tag.de/u/Dan10305)
#### Post date: [January 23, 2024, 10:28am UTC](https://community.mp3tag.de/t/fixing-multiple-feat-in-the-artist-field/63532/8 "2024-01-23T10:28:25Z")

</div>

That is exactly it. Thank you so much I really appreciate the help.  
That has handled all of the tracks in Westside Gunn's album '10' with varying numbers of featured artists.  
Thanks again.

---

<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: [January 23, 2024, 10:32am UTC](https://community.mp3tag.de/t/fixing-multiple-feat-in-the-artist-field/63532/9 "2024-01-23T10:32:24Z")

</div>

> [@LyricsLover](#):
>
> how this works

`Format string: $replace($regexp($replace($regexp(%artist%,(.*?) feat\. (.*),$1==$2), feat.,','),'(.*), (.*)',$1 & $2),==, feat. )`  
You have to read that inside out.  
So: take the initial string from artist and replace the first "feat." with == so that it is something else than all the other "feat"s. You get the first with the greadiness-reducer "?" in the first group description.  
Now replace all the other "feat." in that string with == by commas.  
Then use a regular expression to replace the last comma with an ampersand.  
and finally replace the == with "feat." again.

---

<div class="post-metadata">

### Author: ![Dan10305](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/a88e57/32.png) [@Dan10305](https://community.mp3tag.de/u/Dan10305)
#### Post date: [January 23, 2024, 10:45am UTC](https://community.mp3tag.de/t/fixing-multiple-feat-in-the-artist-field/63532/10 "2024-01-23T10:45:22Z")

</div>

Just to add a note on to this for anyone else who might need to use this solution on their own files - just be aware of any artists with a comma in the name.

There might be a more elegant way to do this but I've run a step before hand to change the artist name (so 'Tyler, the Creator' is changed to 'Tyler the Creator')... then run the fix ...then run a final step to change 'Tyler the Creator' back to 'Tyler, the Creator'

---

<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 22, 2024, 10:45am UTC](https://community.mp3tag.de/t/fixing-multiple-feat-in-the-artist-field/63532/11 "2024-02-22T10:45:48Z")

</div>

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