# Merging several Tag Fields into CONTENTGROUP

**URL:** https://community.mp3tag.de/t/merging-several-tag-fields-into-contentgroup/10616
**Category:** Support
**Created:** [July 4, 2010, 10:31pm UTC](https://community.mp3tag.de/t/merging-several-tag-fields-into-contentgroup/10616 "2010-07-04T22:31:01Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [September 20, 2010, 7:33pm UTC](https://community.mp3tag.de/t/merging-several-tag-fields-into-contentgroup/10616/3 "2010-09-20T19:33:44Z")

</div>

Good question.  
There is a Regular Expression ...  
[http://www.regular-expressions.info/regexb...plicatecsv.html](http://www.regular-expressions.info/regexbuddy/duplicatecsv.html)  
... which should match duplicate comma-delimited items.  
`(?<=,|^)([^,]*)(,\1)+(?=,|$)`

Having this list of items ...  
"Female Vocalists, Indie, Indie Rock, Alternative, Rock, Indie Pop, Pop/Rock, Alternative Rock, Punk, Indie Rock, Alternative/Indie Rock, Alternative Pop/Rock, Garage Rock Revival, Bright, Fun, Stylish, Uplifting, Nostalgic, Exciting, Girls Night Out, Breakup"  
... the Regular Expression matches nothing.

We have to sort the list of items ...  
Alternative Pop/Rock,Alternative Rock,Alternative,Alternative/Indie Rock,Breakup,Bright,Exciting,Female Vocalists,Fun,Garage Rock Revival,Girls Night Out,Indie Pop,Indie Rock,Indie Rock,Indie,Nostalgic,Pop/Rock,Punk,Rock,Stylish,Uplifting  
... now the Regular Expression can find the red colored duplicates.  
But it looks a bit as if there is a quirk in the Regular Expression, because of the also matched comma delimiter between the duplicate items.  
The first matching group is: "Indie Rock".  
The second matching group is: ",Indie Rock".  
Well, when removing one of the matching items, the itemlist will be keep intact as a comma delimited list of items.

Mp3tag has no sort function yet (request has been opened a few days ago).

... to be continued ...

DD.20100920.2332.CEST

---

_[View the full topic](https://community.mp3tag.de/t/merging-several-tag-fields-into-contentgroup/10616)._
