# Regex help - retain only the first artist

**URL:** https://community.mp3tag.de/t/regex-help-retain-only-the-first-artist/57543
**Category:** Support
**Created:** [June 6, 2022, 2:40pm UTC](https://community.mp3tag.de/t/regex-help-retain-only-the-first-artist/57543 "2022-06-06T14:40:46Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![arsaboo](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/ba9def/32.png) [@arsaboo](https://community.mp3tag.de/u/arsaboo)
#### Post date: [June 6, 2022, 2:40pm UTC](https://community.mp3tag.de/t/regex-help-retain-only-the-first-artist/57543/1 "2022-06-06T14:40:46Z")

</div>

Some of my tracks have multiple album artists (separated by `\\`), e.g., `Lata Mangeshkar\\Kishore Kumar`. I would like to replace the same with only the first artist, i.e., `Lata Mangeshkar`.

I tried the following regular expression `(.*)(\\)`, which worked on online regex testing websites, but is doing nothing in mp3tag.

![image](https://community.mp3tag.de/uploads/default/original/2X/9/996e4cd4a61d6d107c132c2843e91de71706163e.png)

Can someone please help me out with removing everything after a separator (`\\` in this case from the `ALBUMARTIST` field)...thanks!

---

<div class="post-metadata">

### Author: ![arsaboo](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/ba9def/32.png) [@arsaboo](https://community.mp3tag.de/u/arsaboo)
#### Post date: [June 6, 2022, 2:53pm UTC](https://community.mp3tag.de/t/regex-help-retain-only-the-first-artist/57543/2 "2022-06-06T14:53:39Z")

</div>

Looks like `Format Value` works. Here's what worked for me:

![image](https://community.mp3tag.de/uploads/default/original/2X/4/45765a4f4783faae99512345e8d0f401d87fd6cc.png)

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [June 6, 2022, 3:14pm UTC](https://community.mp3tag.de/t/regex-help-retain-only-the-first-artist/57543/3 "2022-06-06T15:14:01Z")

</div>

There is also **Remove Duplicate Fields** which leaves the first field from the tag.

> **[Remove Duplicate Fields – Mp3tag Documentation](https://docs.mp3tag.de/actions/remove-duplicate-fields/)**
>
> Documentation on the Remove Duplicate Fields action type that can be performed as Quick Action or as reusable workflow from Action Groups. Mp3tag is the universal Tag Editor.

---

<div class="post-metadata">

### Author: ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)
#### Post date: [June 6, 2022, 3:34pm UTC](https://community.mp3tag.de/t/regex-help-retain-only-the-first-artist/57543/4 "2022-06-06T15:34:02Z")

</div>

@arsaboo Did you have any need to keep the additional text that is being removed in another tag? In your example this would be the artist `Kishore Kumar` info. You would have to address this prior to removing it from the AlbumArtist tag field, or it will be unrecoverable.

---

<div class="post-metadata">

### Author: ![arsaboo](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/ba9def/32.png) [@arsaboo](https://community.mp3tag.de/u/arsaboo)
#### Post date: [June 6, 2022, 3:36pm UTC](https://community.mp3tag.de/t/regex-help-retain-only-the-first-artist/57543/5 "2022-06-06T15:36:48Z")

</div>

Ideally, it would be useful to retain the information, but Plexamp does not work with multiple album artists and it creates more problems.

---

<div class="post-metadata">

### Author: ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)
#### Post date: [June 6, 2022, 3:53pm UTC](https://community.mp3tag.de/t/regex-help-retain-only-the-first-artist/57543/6 "2022-06-06T15:53:20Z")

</div>

You could move the additional details to the Artist field if this does not create any issues with your software. Typically when multiple Artist tag fields are used, only the first one is used for apps that don't support the extra ones. That way you at least have the data remaining in case you want to put it back in the future. Do this action before you delete it from the AlbumArtist field.

---

<div class="post-metadata">

### Author: ![arsaboo](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/ba9def/32.png) [@arsaboo](https://community.mp3tag.de/u/arsaboo)
#### Post date: [June 6, 2022, 3:57pm UTC](https://community.mp3tag.de/t/regex-help-retain-only-the-first-artist/57543/7 "2022-06-06T15:57:28Z")

</div>

Unfortunately, Plex does not quite work that way. It will use all the artists:

 ![image](https://community.mp3tag.de/uploads/default/original/2X/4/468fc4cd33a6621104586fc5ad4915ce0735786d.png)

I like the suggestion of moving the extra information to the artist field. So, now need to figure that out.

---

<div class="post-metadata">

### Author: ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)
#### Post date: [June 6, 2022, 4:12pm UTC](https://community.mp3tag.de/t/regex-help-retain-only-the-first-artist/57543/8 "2022-06-06T16:12:01Z")

</div>

You can use Artist, or any other field including a "Custom" personal field if you like. It is highly unlikely that a player will use this info except for a select few that may let you use it in the Artist field. My point above was more to make sure you keep that data somewhere, as once it is gone it is much more difficult to restore it in the future.

There are plenty of other threads here that can give you guidance on moving data from one field to another. Most will involve the Format or Guess Value actions.

---

<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: [June 6, 2022, 4:58pm UTC](https://community.mp3tag.de/t/regex-help-retain-only-the-first-artist/57543/9 "2022-06-06T16:58:09Z")

</div>

> [@arsaboo](#):
>
> I like the suggestion of moving the extra information to the artist field.

Or you could try other separators like the semicolon or the simple slash and see what your player makes of them.  
To me it looks like your player can actually read all the fields. So it would be worth investigating whether the same track also appears for the other artists.

(And in general: before I throw way information only because a particular player cannot cope with it but it would take ages to get it back, I would change the player and not the data)

---

<div class="post-metadata">

### Author: ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)
#### Post date: [June 9, 2022, 1:39am UTC](https://community.mp3tag.de/t/regex-help-retain-only-the-first-artist/57543/10 "2022-06-09T01:39:53Z")

</div>

> [@ohrenkino](#):
>
> Or you could try other separators like the semicolon or the simple slash and see what your player makes of them.

A personal note regarding the options for separators:  
The semicolon ; is the one I have found in my experience is most accepted on Android (GameMAD and Poweramp\* both support this) and on the Windows platform as well with WMP, MusicBee, and Asset uPnP.  
\*Poweramp can actually use any user defined separator character or string!

Unfortunately the same can’t be said for any of the iStuff from Apple, iTunes has no support whatsoever for any multiple fields.

---

<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: [June 9, 2022, 5:19am UTC](https://community.mp3tag.de/t/regex-help-retain-only-the-first-artist/57543/11 "2022-06-09T05:19:15Z")

</div>

> [@MotleyG](#):
>
> Unfortunately the same can’t be said for any of the iStuff from Apple, iTunes has no support whatsoever for any multiple fields.

Indeed - perhaps this discussion on separators sheds some more light on the topic:

> [@Should I use ";" or "\\\\" or "-" as a separator?](https://community.mp3tag.de/t/should-i-use-or-or-as-a-separator/45708):
>
> To date I have been using a ";" as a separator for the Artist, Composer and Genre fields. I would then do an action of merge duplicate fields for these fields after ripping a CD (or after a bunch of CD's). This displays well with the music players that I use currently but whether if or I may want to use another player in the future I am wondering if there is a better solution that is more universal?. Been thinking about whether it would of been best to use the "\" as a separator or even a …

---

<div class="post-metadata">

### Author: ![arsaboo](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/a/ba9def/32.png) [@arsaboo](https://community.mp3tag.de/u/arsaboo)
#### Post date: [June 9, 2022, 1:47pm UTC](https://community.mp3tag.de/t/regex-help-retain-only-the-first-artist/57543/12 "2022-06-09T13:47:01Z")

</div>

Plexamp does not seem to like `;`. Weirdly enough, `\\` works as a separator in Plexamp for the genre field.

I wish there is some standardization on these basic things.

---

<div class="post-metadata">

### Author: ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)
#### Post date: [June 9, 2022, 2:31pm UTC](https://community.mp3tag.de/t/regex-help-retain-only-the-first-artist/57543/13 "2022-06-09T14:31:25Z")

</div>

This is strange, but perhaps a topic to raise at Plex. I do use Plex myself (not Plexamp though). And the main server does seem to use the semicolon effectively. Perhaps it is just a miss on the Plexamp development side?

---

<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: [July 9, 2022, 2:32pm UTC](https://community.mp3tag.de/t/regex-help-retain-only-the-first-artist/57543/14 "2022-07-09T14:32:17Z")

</div>

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