Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Weekly Challenges

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

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

Want to get involved? We're always looking for ideas and content for Weekly Challenges.

SUBMIT YOUR IDEA

Challenge #174: Appyhay Ondaymay!

PeterA1
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

 

 

estherb47
15 - Aurora
15 - Aurora

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

acastelazo
8 - 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
acastelazo
8 - 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 ")
RWvanLeeuwen
11 - Bolide

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
weird set of rules for this pigspeakweird set of rules for this pigspeak

 

ZenonH
8 - 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
ZenonH
8 - 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

estherb47
15 - Aurora
15 - Aurora

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

Niklas
8 - 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. 

Hannah_Lissaman
11 - Bolide

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