community
cancel
Showing results for 
Search instead for 
Did you mean: 
Do you have the skills to make it to the top? Subscribe to our weekly challenges. Try your best to solve the problem, share your solution, and see how others tackled the same problem. We share our answer too.
Weekly Challenge
Do you have the skills to make it to the top? Subscribe to our weekly challenges. Try your best to solve the problem, share your solution, and see how others tackled the same problem. We share our answer too.
Unable to display your progress at this time. Please try again a little later, or contact an administrator if you continue to see this error.
Announcement | Get certified today - take the Alteryx Designer Core and Advanced exams on-demand now!

Challenge #174: Appyhay Ondaymay!

Alteryx
Alteryx

This one was a marathon but I think i got the fundamentals at least. In the end I think I got the language aspect but unfortunately the punctuation was a casualty.

Spoiler
image.png

 

 

Pulsar

Found it very interesting that if you try to keep everything as a sentence and you use RegEx_Replace to replace strings, words like "I'm" are treated as 2 words - I and 'm, but words like "Don't" are treated as one.

 

Any suggestions to get around this?

 

Also, can you work with functions like TitleCase inside of a Regex_Replace? Otherwise, you need to separate the words, in which case my first paragraph doesn't apply. @AYXAcademy ?

 

Cheers!

Esther

Asteroid

Tried to do it all in Regex, but finally had to cheat at the end and use a formula tool to fix some pesky apostrophes...

 

Thanks to @Jbrooks and @PaceParillo for your helpful advice!

 

Spoiler
Capture.JPG
Asteroid

I did most of mine using the RegEx tool, but also had trouble with "I'm," so I kind of cheated and fixed all of these instances with a Replace() function in the formula tool. Here's what I did:

 

Spoiler
For the words that start with vowels:

Match: \b([aeiouy][a-z']+)
Replace: \1yay

For the words that start with consonants:

Match: \b([^aeiouy ]+)([a-z']*)\b
Replace: \2\1ay

and then I had to fix the capital letters in the middle of words with this:

Match: (\<\w)([a-z']*)([A-Z])([a-z']*)
Replace: \U\1\L\2\L\3\L\4

Finally, I used a formula tool to clean up a couple of exceptions:

Replace([Message], "Iyay'may", "I'myay")
Replace([Message], " a ", " ayay ")
Alteryx Partner

Iway onderway etherwhay isthay allengechay elpthay emay ackletay anyway ealray ifelay enarioscay oweverHay Iway inkthay atthay isthay asway omethingsay atthay idday elphay emay actisepray omesay oremay egExRay

 

anksThay orfay ethay uzzlepay

 

estBay

olandRay

 

Spoiler
174.pngweird set of rules for this pigspeak

 

Asteroid

Fun catching all the mistakes I made along the way. I love practicing RegEx. For my solution I took out the indentation & line breaks.

Spoiler
igPay.PNG
Asteroid

@EstherB47  I used title case once I got to the point where I had my words all sorted out (less capitalization) and it worked, even with leading non-alphas.

 

**Edit: Didn't see you asked for the functionality within RegEx

Pulsar

@Zenon TitleCase for the win!! That's what I used as well

Asteroid

Interesting one, and certainly found use for the skills I learned after @OllieClarke introduced me to RegEx Crosswords.

 

Two things to note:

 - The example in the comment moves the ay to before the apostrophe while the solution moves it to after (ended up solving both ways)

 - The solution turns "you" into "youyay" which I don't think is normal in pig latin

 

Anyway, solution attached. 

Alteryx Certified Partner

Here's my solution - chose not to match the 'youyay' issue in the solution