Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Identify Repeating letters

Esmeralda_In_Paris
8 - Asteroid

Hi, 

 

I need to clean up a list of email addresses. I have noted many emails with repeating letters such as :

xxx@gmail.com
xxxidmcho@naver.com
xx.xxx@gmail.com
xxx@xxx
avaxxxava@gmail.com
xxxxx.yyyyy@hotmail.fr
xxxprettyboy@naver.com
lucaslucasxxx94@gmail.com

 

could you please help me find the emails with a number of repeated letters? 

thank you 

 

 

I have tried this Regex 

([:alpha:])\1+

 

but it does not 

1 REPLY 1
mceleavey
17 - Castor
17 - Castor

Hi @Esmeralda_In_Paris ,

 

This is a tricky one as you have repeating letters in multiple sets within a single string, so I had to break it out into a batch macro:

 

mceleavey_0-1633635373783.png

 

You weren't far off with your regex, but the regex was only telling it to recognise any repeated characters but only return the grouped set, which is singular. I therefore used the regex tool to tokenise to rows on any repeated character, so I ended up with the following:

mceleavey_1-1633635451704.png

 

This told me which characters repeated. I then used this in a batch macro which used the following:

mceleavey_2-1633635490582.png

 

Which is basically the same as yours, but I'm going to overwrite the value in the defined set with the character identified in the first step. This then becomes the value of the first set as a dynamic value.

I then bunched the second clause into a parsed set, which effectively returns the rest of the letters in addition to the first. I then smooshed them together in a formula.

This gives the following:

mceleavey_3-1633635647788.png

 

I hope this helps,

 

M.

 

 

 



Bulien

Labels