/({(?:(?>[^{}]+)¦(?R))*}¦[^{},]+)(?:,¦\s*$)/
/({(?:(?>[^{}]+)¦(?R))*}¦[^{},]+)(?:,¦\s*$)/ that's exactly the reason why people dislike perl, you're never sure if that's what coopster wrote or if the board software scrambled his input ;)
I'll have to check that out once my caffeine-level reaches operational state.
[edited by: phranque at 7:33 am (utc) on Feb. 19, 2009]
[edit reason] fix graphic smiley in the regexp :( [/edit]
The ?R is the recursion. I'm checking for one or more recursive patterns inside braces OR one or more of anything that is not an opening brace, closing brace, or comma. That is then followed by either a comma or zero or more space characters and the end.
?: is the instruction to not capture a subpattern.
I don't recall which version of the engine introduced recursion, but I've used it on a number of occasions. It takes a few minutes to wrap your head around but you will certainly appreciate it's usefulness once you do.