Regex to remove duplicate strings in a field

I'm trying to remove duplicate strings in a field. The values are comma separated like this:

Abc, xyz, DeF, lmno, zebra, monkey, xyz, lmno, Abc

There can be anywhere from 0 to many (~20) items in the list.

I'd like a regex to remove duplicates.

So

Abc, xyz, DeF, lmno, zebra, monkey, xyz, lmno, Abc
becomes
Abc, xyz, DeF, lmno, zebra, monkey
or
DeF, zebra, monkey, xyz, lmno, Abc

Thanks for any suggestions!

See e.g. here:

Thanks @ohrenkino for the pointer. It wasn't a 100% solution, but it put me on a path that was helpful. The uber-nested regex is a bear to understand...I used Perplexity AI to help me understand what it was doing at a high level, and then dusted off my debugging skills, read a lot of reference stuff and eventually sorted out what I needed.

My goal was to de-dupe a list of comma separated keywords. Many of the words are in CamelCase (e.g. DancePop, NewWave, PopRock).

Perplexity gave me a few suggestions, but the code it provided didn't work perfectly in MP3Tag/Boost.

Here's what did work eventually:

Action type: Format Value
Field: ContentGroup
Format String:

$regexp($reverse($regexp($reverse($regexp($regexp(%ContentGroup%,'^(\s+,|\s,+)+|(\s+,|\s,+)+$|((?<=,)\s+)|(\s+(?=,))',' '),'\b([^,\s]+(?:\s+[^,\s]+))\s,\s*(?=.*\b\1\b)',)),'^,+|,+$',' ')),'(?<=,)',)

One of the challenges I had with another action I found was it would take input like:
Pop, Rock, PopRock, Instrumental
and would see the "Rock," on the end of PopRock as the same as the Rock that occurred earlier in the field...and delete one of the values.

My solution looks for word boundaries to avoid that issue.

Hope this helps others.

Many thanks to @Florian and the community here for such a great tool and sharing of knowledge.