This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
(?=.*\b\1): Then check whether you can match the same identifier, somewhere ahead in the string.
What this regex does is it checks the first occurrence of the word then match the same identifier ahead of that word and replaces the first value with the blank as per regex_replace done in my post above.