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'm getting caught up with how to use the back-references.
For example:
1,1,1,2,2,3,3,3,3,4,4,4,5
Becomes:
1,2,3,4,5
Or:
a,b,b,said,said, t, u, ugly, ugly
Becomes
a,b,said,t,u,ugly
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…