We've recently made an accessibility improvement to the community and therefore posts without any content are no longer allowed. Please use the spoiler feature or add a short message in the message body in order to submit your weekly challenge.

Weekly Challenge

Solve the challenge, share your solution and summit the ranks of our Community!

Also available in | Français | Português | Español | 日本語
IDEAS WANTED

We're actively looking for ideas on how to improve Weekly Challenges and would love to hear what you think!

Submit Feedback

Challenge #130: Is There an Echo in Here?

JoeM
Alteryx Alumni (Retired)

You 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?Deja Vu anyone anyone?

 

JoBen
11 - Bolide

Good post! Cheers!

danilang
18 - Pollux
18 - Pollux

The power in that one tool!  Even if the syntax is almost as convoluted as APL

 

APL.png

Spoiler
Solution 130.png

 

Dan

danrh
13 - Pulsar
Spoiler
I'm not sure how I survived before I discovered RegEx...

REGEX_Replace([Phrase], '(^|[ ])(.*) (\2)', '$1$2')

 

ggruccio
ACE Emeritus
ACE Emeritus

Will have to look at those one-tool solutions - Impressive!

 

For this one I had an immediate idea to solve it a certain way --- which worked!

patrick_digan
16 - Nebula
16 - Nebula

Here is my 1 tool solution. 

Spoiler
Isn't it funny how we're all accomplishing the same thing but our regex expressions are slightly different and will handle new data slightly differently....

Capture.PNG
brgilbert
7 - Meteor

Learning RegEx so it's helpful to see examples of how it all works.  

 

Spoiler
REGEX_Replace([Phrase], '(^|\s)(.*) (\2)', "$1$2")
mpennington
11 - Bolide

Solution attached.

 

Spoiler
Always a bit of trial and error for me to make these RegEx patterns work, but I think I got it.  MP 130.jpg
OldDogNewTricks
10 - Fireball

1 tool solution...

papalow
8 - Asteroid

Thank you for the challenge