# Unify expressions with regex

**URL:** https://community.mp3tag.de/t/unify-expressions-with-regex/65489
**Category:** Support
**Created:** [August 5, 2024, 5:36pm UTC](https://community.mp3tag.de/t/unify-expressions-with-regex/65489 "2024-08-05T17:36:01Z")
**Posts on this page:** 5
**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: [August 5, 2024, 5:36pm UTC](https://community.mp3tag.de/t/unify-expressions-with-regex/65489/1 "2024-08-05T17:36:01Z")

</div>

I have a field 'Role' with, for example, the following entries:  
`Alt Vocals\\Alt Voice\\Alto Vocals\\Alto Guitar\\Soprano Vocals\\Soprano Voice\\Soprano Clarinet\\Soprano Saxophone`

These should be standardized:  
Alto Voice\Alto Voice\Alto Voice\Alto Guitar\Soprano Voice\Soprano Voice\Soprano Clarinet\Soprano Saxophon

Duplicate expressions should be avoided.

This doesn't work with replacement and my knowledge is too rudimentary for regex. Can someone help me?

---

<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 5, 2024, 6:11pm UTC](https://community.mp3tag.de/t/unify-expressions-with-regex/65489/2 "2024-08-05T18:11:34Z")

</div>

The double backslash indicates that you have multi-value fields.  
You would have to merge them first.  
See this thread on the treatment of list with duplicate words:

> [@Merge duplicate words](https://community.mp3tag.de/t/merge-duplicate-words/16289):
>
> Hi, I would like to find in genre duplicate words and merge them together. This is an example of genre tag: Before AFRICA; AFRICA; NATURAL WORLD; NATURE STUDY; NATURE; DRAMA ADVENTURE; DRAMA WORLD; PERCUSSION; INSTRUMENTS SOLO PERCUSSION; WILDLIFE MOVEMENT; DRAMA ADVENTURE; AFRICA; FILM STYLES ANCIENT ROME; AFRICA After AFRICA; NATURAL WORLD; NATURE STUDY; NATURE; DRAMA WORLD; PERCUSSION; INSTRUMENTS SOLO PERCUSSION; WILDLIFE MOVEMENT; DRAMA ADVENTURE; FILM STYLES ANCIENT ROME ; is the …

---

<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: [August 5, 2024, 6:41pm UTC](https://community.mp3tag.de/t/unify-expressions-with-regex/65489/3 "2024-08-05T18:41:50Z")

</div>

Thank you, ohrenkino.  
So i tried. The Problem is the replace. Soprono from Voice and Soprono from Clarinet gives: Soprono Stimmeklarinette and so on. I think i habe to do it mit regex. But I do not know how.

---

<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 5, 2024, 6:45pm UTC](https://community.mp3tag.de/t/unify-expressions-with-regex/65489/4 "2024-08-05T18:45:24Z")

</div>

> [@MusikBaum](#):
>
> I think i habe to do it mit rege

To merge fields, use an action:

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

specify semicolon space as separator.  
Then apply the code from the linked thread.

---

<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 4, 2024, 6:45pm UTC](https://community.mp3tag.de/t/unify-expressions-with-regex/65489/5 "2024-09-04T18:45:47Z")

</div>

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