I have looked everywhere for a solution, and have found nothing to pre-exist. All the other posts anywhere close to this either deal with multiple fields (I have just one field) named Genre, don't work, or removes everything after the first \\'s, and are several years old posts.
I have ONE genre field (not multiple,) and want to cut out duplicates out of the same (not multiple) fields.
Notice how "metal" is repeated multiple times throughout the tag, among others. It can be cut down a ton, ignore that.
I want the duplicates of the same genre removed from the (singular) tag, each separated by \\, and not deleting anything past the first set of \'s, because I want to keep everything that isn't a duplicate.
Here's what I want the tag to visually be from the "cut down" one;
The dump that you kindly supplied shows data with a double backslash \\ which is in MP3tag usually the indicator that there are actually multiple fields of the same type.
Could you check the extended tags dialogue Alt-T whether how many fields of the type genre there are?
If you find several, then merge this field into one with an action of the type
and use something unlike the double backslash as separator. A (comma or) semicolon would be nice.
And then have a look at this thread:
That is most astounding.
I just created a field with
Classic; Album; Rock; Blue; Folk; Hard; Rock; Country & Rock & Roll
Which should be reduced by 1 "Rock"
when treated with $regexp($reverse($regexp($regexp($reverse($regexp($regexp(%Genre%,'^(\s+;*|\s*;+)+|(\s+;*|\s*;+)+$|((?<=;)\s+)|(\s+(?=;))',),'^|$',';')),'(;[^;]+)(?=(\1|;.*?\1))',),'^;+|;+$',)),'(?<=;)',' ')
And the preview in Convert>Tag-Tag shows:
"Classic; Album; Rock; Blue; Folk; Hard; Rock; Country & Rock & Roll" ->
"Classic; Album; Rock; Blue; Folk; Hard; Country & Rock & Roll"
which I think is just about right.
I also used it on
"Alternative; Metal; English; Groove; Nu-Metal; Heavy; Nu; Charts; Rock; Indie; Rock; Thrash" ->
"Alternative; Metal; English; Groove; Nu-Metal; Heavy; Nu; Charts; Rock; Indie; Thrash"
and this would lead me to the statement: works as designed.
Or an action of the type "Format value". So there is no single place.
$Regexp() is a scripting function and may be used where a "format string" is required.
The action of the type "Replace with regular expression" asks for a source pattern (or something similar but no format string).
Also, you did not say in which action you tried to get it working.
Yet, the linked thread clearly states