I tried to search for this particular problem, but all I get is either deleting duplicate rows or deleting duplicate rows where they are separated by a separator.
My problem is slightly different. I have a string like
"comp name1 comp name2 comp name2 comp name3"
where I want to remove the duplicate name comp2 and return only
"comp name1 comp name2 comp name3"
These are not consecutive repeating words, but consecutive duplicates of substrings. Is there a way to solve this problem with regular expressions?
source share