I\'m trying to figure out how to filter out duplicates in a string with a regular expression, where the string is comma separated. I\'d like to do this in javascript, but I\
Here's a example:
s/,([^,]+),\1/,$1/g;
Perl regex substitution, but should be convertible to JS-style by anyone who knows the syntax.