Remove duplicate using regex jquery -
i've below text in file.
10 - black 10 - black 10 - black 10 - black 10 - black 20 - grey/black 20 - grey/black 20 - grey/black 20 - grey/black 20 - grey/black 30 - blue 30 - blue 30 - blue 30 - blue 30 - blue 40 - brown/red 40 - brown/red 40 - brown/red 40 - brown/red 40 - brown/red
here want replace following duplicates, remain letter below is.
in simple want output below.
10 - black 20 - grey/black 30 - blue 40 - brown/red
here's regex code: (\b[^\n,]+)\n(?=.*\b\1\b)
regex101: https://regex101.com/r/wf0ag1/1
Comments
Post a Comment