# Performer Role Regular Expression

**URL:** https://community.mp3tag.de/t/performer-role-regular-expression/52697
**Category:** Support
**Created:** [April 6, 2021, 9:57am UTC](https://community.mp3tag.de/t/performer-role-regular-expression/52697 "2021-04-06T09:57:35Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![MusikBaum](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@MusikBaum](https://community.mp3tag.de/u/MusikBaum)
#### Post date: [April 6, 2021, 9:57am UTC](https://community.mp3tag.de/t/performer-role-regular-expression/52697/1 "2021-04-06T09:57:35Z")

</div>

I found:

> [@Regular Expressions](https://community.mp3tag.de/t/regular-expressions/521/47):
>
> How to copy a list of artists and their roles ... ... from tag-field COMMENT ... to tag-field INVOLVEDPEOPLE Example 1 From: COMMENT Person1:Role1 Person2:Role2 Person3:Role3 To: INVOLVEDPEOPLE Role1:Person1;Role2:Person2;Role3:Person3; Action: Format value Field: INVOLVEDPEOPLE Formatstring: $regexp(%COMMENT%$char(13),'(.+?):(.+?)[\r\n]+','$2:$1;') Example 2 From: COMMENT Person1:Role1 Person2: Role2a,Role2b Person3 : Role3a, Role3b Person4: Role4a & Role4b, Role4c To: INVOLV…

My problem is a little different:

Person = first name last name or first name first name last name or first name first name xxx last name  
Role: e.g. tenor saxophone, clarinet, piano [xxx 1855]

Source %soloist% (multi-tag \, any order and number of tags):  
`Person1 - Role1\\Person2 - Role2a, Role2b, ..., Roll2x\\Person3 - Role1`

Target: %soloistsort% (PersonSort: Last name, first name):

`PersonSort1 - Rolle1\\PersonSort2 - Rolle2a, Rolle2b, ..., Roll2x\\PersonSort3 - Rolle1`

What would the solution look like? - I have too little knowledge.

---

<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: [April 6, 2021, 11:14am UTC](https://community.mp3tag.de/t/performer-role-regular-expression/52697/2 "2021-04-06T11:14:05Z")

</div>

You could try  
`$replace($trim($regexp($meta_sep(soloist,; ); ,'(.*?) (.*?) - (.*?); ','$2, $1 - $3; ')),; ,\\,;,)`

---

<div class="post-metadata">

### Author: ![MusikBaum](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/85f322/32.png) [@MusikBaum](https://community.mp3tag.de/u/MusikBaum)
#### Post date: [April 6, 2021, 11:49am UTC](https://community.mp3tag.de/t/performer-role-regular-expression/52697/3 "2021-04-06T11:49:33Z")

</div>

Thank you ohrenkino! Another solution that makes tagging easier for me.

---

<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: [August 10, 2024, 7:32am UTC](https://community.mp3tag.de/t/performer-role-regular-expression/52697/4 "2024-08-10T07:32:20Z")

</div>

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