Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Regex for variations of a phrase

FreeRangeDingo
11 - Bolide
11 - Bolide

I have a text column for comments (see example below), and I need to know (True/False) whether it contains the misrun or misfire.  Misrun and misfire can be spelled or annotated with special characters.  I currently have a contains formula trying to find all the different spellings, but I know this is not a good way to do it.  Note, misrun and misfire can occur anywhere in the string. 

 

I know I can use the Regex tool set to Match to give me the true/false, but I don't know enough regex to write it.  Help would be greatly appreciated.  Thank you.

 

comments.pngvariations.png

12 REPLIES 12
Thableaus
17 - Castor
17 - Castor

Hi @FreeRangeDingo 

 

I think this is the kind of situation you could use some Fuzzy Match + data prep to get what you want, because writing a perfect REGEX could rbe a little trouble, since there might be a lot of variations.

 

Cheers,

joshuaburkhow
ACE Emeritus
ACE Emeritus

Couldn't you just simplify this to either contains "run" or "fire" then you don't need all those combinations. 

Joshua Burkhow - Alteryx Ace | Global Alteryx Architect @PwC | Blogger @ AlterTricks
MarqueeCrew
20 - Arcturus
20 - Arcturus
You could try:

Regex_match([perfstatus comment],"\bmis[^a-zA-Z]*?run\b")

The search will find words beginning with MIS that may be followed by non-letters followed by run and ending the word.

Cheers,

Mark
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
joshuaburkhow
ACE Emeritus
ACE Emeritus

Couldn't you just simplify this to either contains "run" or "fire"? then you don't need all those combinations. 

Joshua Burkhow - Alteryx Ace | Global Alteryx Architect @PwC | Blogger @ AlterTricks
FreeRangeDingo
11 - Bolide
11 - Bolide

Unfortunately not.  Something I don't want to flag is "All shots fired".  Good thought though. 

FreeRangeDingo
11 - Bolide
11 - Bolide

I will give Fuzzy Match a try.  I've not had good luck with it in the past.

MarqueeCrew
20 - Arcturus
20 - Arcturus
Please try my regex first!
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
FreeRangeDingo
11 - Bolide
11 - Bolide

I just hit run!  One sec....  🙂

FreeRangeDingo
11 - Bolide
11 - Bolide

Mark, 

   The regex expression did not return any matched.  ??? Is there more info I can provide?

 

Thanks,

 

Julie

Labels