# Action Regex Help: copy features from title to artist with \\\\ separation

**URL:** https://community.mp3tag.de/t/action-regex-help-copy-features-from-title-to-artist-with-separation/65506
**Category:** Support
**Created:** [August 6, 2024, 4:25pm UTC](https://community.mp3tag.de/t/action-regex-help-copy-features-from-title-to-artist-with-separation/65506 "2024-08-06T16:25:01Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![driedpaint](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/d2c977/32.png) [@driedpaint](https://community.mp3tag.de/u/driedpaint)
#### Post date: [August 6, 2024, 4:25pm UTC](https://community.mp3tag.de/t/action-regex-help-copy-features-from-title-to-artist-with-separation/65506/1 "2024-08-06T16:25:01Z")

</div>

I've gone a bit cross-eyed trying to work out this RegEx. Here is an example of what I'm hoping to do:

TITLE: That's Just How It Is (feat. Ty Dolla $ign, Leon Thomas & The-Dream)  
ARTIST: A$AP Rocky

I would like the title to remain unchanged but I would like artist to change to:

ARTIST: `A$AP Rocky\\Ty Dolla $ign\\Leon Thomas\\The-Dream`

The closest I have come is this:

ACTION: Guess Values  
SOURCE FORMAT: `$regexp(%artist% - %title%,(.*) - (.*) \(feat. (.*)\),$1\\\\$3)`  
GUESSING PATTERN: `%artist%`

which gives:

ARTIST: `A$AP Rocky\\Ty Dolla $ign, Leon Thomas & The-Dream`

How can I split `$3` into the individual items and apply the `\\\\` between each?

For further use it should also account for the fact that sometimes there's only a single artist featured ex: (feat. Ty Dolla $ign). If there are exactly two featured artists it is often with an ampersand only and no commas ex: (feat. Ty Dolla $ign & The-Dream). Three or more artists is as the original example, comma separated until the final two which are ampersand separated.

Any help greatly appreciated!

edit tldr:  
**BEFORE**  
TITLE: `That's Just How It Is (feat. Ty Dolla $ign, Leon Thomas & The-Dream)`  
ARTIST: `A$AP Rocky`

**AFTER**  
TITLE: `That's Just How It Is (feat. Ty Dolla $ign, Leon Thomas & The-Dream)`  
ARTIST: `A$AP Rocky\\Ty Dolla $ign\\Leon Thomas\\The-Dream`

---

<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: [August 6, 2024, 5:04pm UTC](https://community.mp3tag.de/t/action-regex-help-copy-features-from-title-to-artist-with-separation/65506/2 "2024-08-06T17:04:42Z")

</div>

The `\\` indicate a multi-value field that you have to merge first to get access to all of the data in 1 string.  
Use `$meta_sep(artist, & )` or a suitable different separator from the `&` and then apply "Guess value".

---

<div class="post-metadata">

### Author: ![driedpaint](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/d2c977/32.png) [@driedpaint](https://community.mp3tag.de/u/driedpaint)
#### Post date: [August 6, 2024, 5:23pm UTC](https://community.mp3tag.de/t/action-regex-help-copy-features-from-title-to-artist-with-separation/65506/3 "2024-08-06T17:23:01Z")

</div>

I'm not sure I understand how that would work here. The data is all in one string already (the title), I want to take that and add it to the artist field, thus changing artist to a multi-value field in the process.

---

<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: [August 6, 2024, 5:35pm UTC](https://community.mp3tag.de/t/action-regex-help-copy-features-from-title-to-artist-with-separation/65506/4 "2024-08-06T17:35:22Z")

</div>

I misunderstood, sorry.  
You could try:  
`%artist%\\$replace($regexp(%title%,'(.*) \(feat. (.*)\)',$2),', ',\\, & ,\\)`  
You would not need "Guess value" but "Format value" would work just as fine as you do not split the contents into different fields.

---

<div class="post-metadata">

### Author: ![driedpaint](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/d2c977/32.png) [@driedpaint](https://community.mp3tag.de/u/driedpaint)
#### Post date: [August 6, 2024, 6:56pm UTC](https://community.mp3tag.de/t/action-regex-help-copy-features-from-title-to-artist-with-separation/65506/5 "2024-08-06T18:56:12Z")

</div>

That is perfect! Thank you so much.

---

<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: [September 5, 2024, 6:56pm UTC](https://community.mp3tag.de/t/action-regex-help-copy-features-from-title-to-artist-with-separation/65506/6 "2024-09-05T18:56:59Z")

</div>

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