# 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:** 11

<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 24, 2010, 10:56am UTC](https://community.mp3tag.de/t/merging-several-tag-fields-into-contentgroup/10616/11 "2010-09-24T10:56:49Z")

</div>

> [@pmj1989](#):
>
> Here it is  
> (?:(?\<=,)|(?\<=\A)) ?([^,]_),(?=._?(?\<=,) ?\1(?=,|\z)) ...

pmj1989, yes, it is!

Should I say, just perfect or just _nearly_ perfect?  
I never thought that the given problem to "de-dup" an item list could be solved with such a small linear expression. Regular expressions can be really mighty.

I modified the expression a little bit to work with multi-line textfields too, but I have not tested it in full depth.

`(?:(?<=,|\A|^))\s?([^,]*),(?=.*?(?<=,)\s?\1(?=,|\Z|$))(?#de-dup comma- or comma+space- delimited list)`

DD.20100924.1456.CEST

---

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