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

<div class="post-metadata">

### Author: ![ptrk.mj](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ptrk.mj/32/300_2.png) [@ptrk.mj](https://community.mp3tag.de/u/ptrk.mj)
#### Post date: [September 21, 2010, 9:12pm UTC](https://community.mp3tag.de/t/merging-several-tag-fields-into-contentgroup/10616/7 "2010-09-21T21:12:07Z")

</div>

Oops! I guess I was too lazy and convinced of compatibilty between my regex crafting tool (RegexBuddy with Perl flavor enabled) and Mp3tag.

The regex is not working as intended and that's a fact, however I don't get any error!

Firstly, this is what I get:

Format string:  
`$regexp('aaa,aaa,aaa,bbb,ccc,bbb,ddd,ddd,ddd,ccc,eee,fff,GGG,ggg,iii','(?<=,|\A) ?([^,]*),(?=.*?(?<=,) ?\1(?=,|\z))',,1)`

Results in:  
aaa,aaa,bbb,ddd,ccc,eee,fff,ggg,iii

No error. But still not our goal.  
Please try to reproduce this by pasting the string inside Tag-Filename dialog (the most convinient way for me) and check if the error occurs.

"Invalid lookbehind assertion encountered..." is the type of error showing up due to lookbehind limitation in Perl flavor

> [@](#):
>
> (...) many regex flavors, including those used by Perl and Python, only allow fixed-length strings. You can use any regex of which the length of the match can be predetermined. This means you can use literal text and character classes. You cannot use repetition or optional items. You can use alternation, but only if all options in the alternation have the same length.

The dubious part of our expression is the initial lookbehind `(?<=,|\A)` since it's not really fixed-length (Start of string anchor is zero-length). I'll try to fix this problem tomorrow.

> [@](#):
>
> Hey pmj1989, so far, good work!

Thanks to links you provided me few months ago 🙂

---

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