# Regex replace help for multi-value fields

**URL:** https://community.mp3tag.de/t/regex-replace-help-for-multi-value-fields/56856
**Category:** Support
**Created:** [March 29, 2022, 9:08pm UTC](https://community.mp3tag.de/t/regex-replace-help-for-multi-value-fields/56856 "2022-03-29T21:08:26Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Zapgok](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/z/8797f3/32.png) [@Zapgok](https://community.mp3tag.de/u/Zapgok)
#### Post date: [March 29, 2022, 9:08pm UTC](https://community.mp3tag.de/t/regex-replace-help-for-multi-value-fields/56856/1 "2022-03-29T21:08:26Z")

</div>

I'm trying to create an action to insert a string at the end of a (split) multi-value field to be used on both current and future files. My problem is that I only want this replacement to take place based on certain conditions, namely, whether the current value ends in a parentheses or not.

How my tags look now:

```auto
ARTIST = Aerosmith
TITLE = Mama Kin
PERFORMER = Aerosmith
PERFORMER = Steven Tyler (Vocals)

```

What I'm trying to achieve:

```auto
ARTIST = Aerosmith
TITLE = Mama Kin
PERFORMER = Aerosmith (Performer)
PERFORMER = Steven Tyler (Vocals)

```

The reason for this is that my library manager uses whatever is encased in parentheses as the 'role', which currently causes 'Aerosmith' to show up in the list along with 'Guitar', 'Drums', 'Piano' and so on.

The fact that I've not even been able to filter out these files correctly, using various combinations of regex and syntaxes, leads me to believe that I'm missing something and I would really appreciate some assistance.

---

<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: [March 29, 2022, 9:55pm UTC](https://community.mp3tag.de/t/regex-replace-help-for-multi-value-fields/56856/2 "2022-03-29T21:55:54Z")

</div>

You are looking for an action which appends  
space`(Performer)`  
to any entry in your PERFORMER tag which not already have any value in brackets, right?

If you want to

> [@Zapgok](#):
>
> filter out these files correctly,

you could press F3 and enter  
`NOT PERFORMER MATCHES \(`  
this would show you all tracks where the PERFORMER tag doesn't include an opening bracket

You can find more examples here:

> [@Filter expressions](https://community.mp3tag.de/t/filter-expressions/10080):
>
> This topic collects useful Filter expressions If you have a useful filter expression, please post it here and give a short description of what it does. These filter expressions can be used with the Mp3tag filter [F3]. Please look at [https://docs.mp3tag.de/filter](https://docs.mp3tag.de/filter) for the documentation. Notes All filter keywords must be uppercase. All operations are case insensitive, for a workaround see [this post](https://community.mp3tag.de/t/10080/4).

---

<div class="post-metadata">

### Author: ![Zapgok](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/z/8797f3/32.png) [@Zapgok](https://community.mp3tag.de/u/Zapgok)
#### Post date: [March 30, 2022, 2:26am UTC](https://community.mp3tag.de/t/regex-replace-help-for-multi-value-fields/56856/3 "2022-03-30T02:26:09Z")

</div>

Thanks for the reply! You've understood what I'm asking for exactly.

I tried what you're suggesting already but it's showing me all files that doesn't have a PERFORMER tag at all (possibly also the files I'm looking for but there's no way for me to check that without going through thousands of files). Which, technically is correct, it's showing me files where there's no brackets in the PERFORMER tag because there is no PERFORMER tag...

I also tried:

```auto
performer PRESENT NOT performer MATCHES \(

```

That just shows me every single file currently open i MP3tag.

---

<div class="post-metadata">

### Author: ![poster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/poster/32/4881_2.png) [@poster](https://community.mp3tag.de/u/poster)
#### Post date: [March 30, 2022, 4:32am UTC](https://community.mp3tag.de/t/regex-replace-help-for-multi-value-fields/56856/4 "2022-03-30T04:32:45Z")

</div>

> [@Zapgok](#):
>
> `performer PRESENT NOT performer MATCHES \(`

There is an `AND` missing.  
`performer PRESENT AND NOT performer MATCHES \(`

---

<div class="post-metadata">

### Author: ![Zapgok](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/z/8797f3/32.png) [@Zapgok](https://community.mp3tag.de/u/Zapgok)
#### Post date: [March 31, 2022, 12:43am UTC](https://community.mp3tag.de/t/regex-replace-help-for-multi-value-fields/56856/5 "2022-03-31T00:43:59Z")

</div>

Apologies for the sloppy previous reply. AND was included and I just tried it again to make sure, the result is no filtered files.

Is it possible that MP3tag reads the performer tag as one long string even though it shows up as split in the extended tags view?

Edit: I've re-evaluated my objective a bit so it looks like this:

If the artist is also present in the performer tag but without an assigned role, then that performer tag should be deleted.

If a name that doesn't match the artist field is present in the performer tag but without an assigned role (same as OP - if there's no parentheses in that performer tag) then that tag should be appended with " (Performer)".

I'm thinking that the first one can be solved by creating an action and modifying:

"$if($eql(%artist%,%performer%),yes,no)"

"yes" could be replaced with a regex that deletes the tag in question if I understand it correctly?

The second one with the parentheses is still the one I'm struggling with.

---

<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 31, 2022, 6:28am UTC](https://community.mp3tag.de/t/regex-replace-help-for-multi-value-fields/56856/6 "2022-03-31T06:28:23Z")

</div>

> [@Zapgok](#):
>
> If the artist is also present in the performer tag but without an assigned role, then that performer tag should be deleted.

you could achieve this with 2 actions, each of the type "Format value" for PERFORMER  
Format string: `$replace($meta_sep(performer,\\),%artist%\\,)`  
which caters for the performer = artist without role that comes first and the second  
Format string: `$regexp($meta_sep(performer,\\),'(.*?\(.*?)\\\\'%artist%'$',$1)`  
which caters for the performers=artist without role that come last.  
And then you only have to filter for the remaining performers without parenthesis and add the string..

---

<div class="post-metadata">

### Author: ![Zapgok](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/z/8797f3/32.png) [@Zapgok](https://community.mp3tag.de/u/Zapgok)
#### Post date: [April 2, 2022, 3:57am UTC](https://community.mp3tag.de/t/regex-replace-help-for-multi-value-fields/56856/7 "2022-04-02T03:57:31Z")

</div>

Appreciate the solution, thank you! After some consideration I decided to do this directly in Picard instead due to how it handles the performer tag and everything seems to be working as intended. Thanks to everyone for the input and assistance! 😃

---

<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:29pm UTC](https://community.mp3tag.de/t/regex-replace-help-for-multi-value-fields/56856/8 "2026-02-09T12:29:43Z")

</div>


