Artist1/Artist2 should become Artist1 - Song title (feat. Artist 2)

Hey, I've been using ChatGPT for about a half an hour but nothing it tells me works. Maybe you could help me :confused:

I tried all the above, and what happens is it shortens ARTIST: Artist1/Artist2/Artist3 to Artist1, but in the TITLE it changes it to

"Song title (feat. REGEXP ERROR: Regular expression

Invalid preceding regular expression prior to repetition operator. The error occurred while parsing the regular expression: '^+>>>HERE>>> & (.+)$'.)"

Many thanks in advance! :confused:


  • Input: ARTIST field contains multiple artists separated by slashes, e.g.
    Artist1/Artist2/Artist3/Artist4
  • Desired output:
  • ARTIST field should keep only the first artist (e.g. Artist1)
  • TITLE field should be appended with (feat. Artist2, Artist3 & Artist4)
    • Use commas to separate all featured artists except the last one, which is joined by &
    • If only one featured artist (e.g. Artist1/Artist2), then TITLE is appended with (feat. Artist2) (no ampersand)

What I tried so far

I tried to create an Mp3tag action group with these steps:

1. Save original ARTIST field to a temporary tag

  • Action: Format tag field
  • Field: ARTIST_ORIGINAL
  • Format string:
%ARTIST%

This is to keep a backup of the original list of artists, because we will modify the ARTIST field next.

2. Shorten ARTIST to only the first artist

  • Action: Replace with regular expression
  • Field: ARTIST
  • RegEx:
^([^/]+).*
  • Replace with:
$1

3. Extract all remaining artists (except the first) into a temporary field TMP_FEAT

  • Action: Format tag field
  • Field: TMP_FEAT
  • Format string:
$regexp(%ARTIST_ORIGINAL%,^[^/]+/(.+)$,$1)

4. Replace slashes / in TMP_FEAT with commas and an ampersand before the last artist

I tried this to convert / into proper formatting like Artist2, Artist3 & Artist4:

  • Action: Format tag field
  • Field: TMP_FEAT
  • Format string:
$replace($regexp(%TMP_FEAT%,^(.*)/(.+)$,$1 & $2),/,\,)

5. Append (feat. TMP_FEAT) to the TITLE field, only if TMP_FEAT exists

  • Action: Format tag field
  • Field: TITLE
  • Format string:
%TITLE%$if(%TMP_FEAT%, (feat. %TMP_FEAT%),)

6. (Optional) Remove the temporary field TMP_FEAT after processing

  • Action: Remove tag field
  • Field: TMP_FEAT

I suggest trying your regular expressions in the 'Convert Tag -> Tag' dialog first to see where the syntax error is.
The result of your regular expression is immediately visible in the text between your format string and the Preview button


The above syntax is not valid as a Mp3tag regular expression.

You can easily adjust the syntax in this dialogue window until it works for you.
Then you can also use the regular expression in an Action.

Try an action of the type "Guess value"
Source format: $regexp('Artist1/Artist2/Artist3/Artist4',(.*?)\/(.*),$1)==%title% (feat. $regexp($replace($regexp('Artist1/Artist2/Artist3/Artist4',(.*?)/(.*),$2),/,', '),'(.*), (.*)',$1 & $2))
Guessing pattern: %artist%==%title%

You can test the source format in Convert>Tag-Tag which should show in the preview:
"Artist1==Mytitle (feat. Artist2, Artist3 & Artist4)"