Alteryx Designer Desktop Discussions

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

Check for same repeated characters

AndrewCrayford
8 - Asteroid

I was wondering if anyone got any ideas of how can i check for the same repeated characters in a field.

 

For example

 

If the field (Addline) does contain any same repeat of characters eg AAAAA or /// which has been repeated more than 3 times?

 

 

 

 

4 REPLIES 4
MarqueeCrew
20 - Arcturus
20 - Arcturus

Ok @AndrewCrayford.  So you want to start my day off with a challenge.  I can appreciate that.

 

REGEX_match([addline], ".*(.)\1{2,}.*")

This pattern will look for any character within a string that is found 3 consecutive times or more.

 

Cheers,

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
AndrewCrayford
8 - Asteroid

Thanks for the quick reply @MarqueeCrew

 

I guess if it returns a -1 then it found a character 3 or more times otherwise it returns an 0 is that correct?

MarqueeCrew
20 - Arcturus
20 - Arcturus

I would define the new field as BOOL then you'll see True and False.

 

Cheers,

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
AndrewCrayford
8 - Asteroid

Cool, many thanks

Labels