Regex replace help for multi-value fields

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:

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

What I'm trying to achieve:

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.

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

If you want to

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

You can find more examples here:

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:

performer PRESENT NOT performer MATCHES \(

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

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

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:


"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.

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..

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! :smiley: