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.
We're actively looking for ideas on how to improve Weekly Challenges and would love to hear what you think!
Submit FeedbackYou have a source system that doesn't seem to be working quite as expected. The system will frequently take any given word and duplicate it within a string. You job is to clean it up! Below we have a few sample phrases that are indicative of the system's problem. Find all words that have duplicate consecutive words and reduce the duplication to a single word again!
(Advanced Users: There is a one tool solution for this!)
Deja Vu anyone anyone?
REGEX_Replace([Phrase], '(^|[ ])(.*) (\2)', '$1$2')
Here is my 1 tool solution.
Learning RegEx so it's helpful to see examples of how it all works.
Solution attached.