Alteryx Designer Desktop Discussions

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

Regex Match only a Word or Words in ALL CAPS and nothing else

hellyars
13 - Pulsar

 

Help.  My input is Field1.  I want to match words in ALL CAPS.  There can be 1-N words.  I want to ignore lines that might start with an ALL CAPS word or words but that contain other text.

 

I tried the following expression.  It works, but there is an anomaly.  It captures { -- when it should not.   How can I fix this?

 

 

if REGEX_Match([Field1], Uppercase([Field1]),0) then [Field1] else '' endif 

 

 

 

Example below.  Note { ends up in New when it should not.

 

Field1New
var addthis_config = { 
data_use_flash: false, 
}}
BIKESExcepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.ices in support o... 
SPECIALIZEDSPECIALIZED
ROUBAIX PROROUBAIX PRO
SWIM BIKE RUNSWIM BIKE RUN
  
3 REPLIES 3
DeanWest
9 - Comet

Try using this Regular Expression in your Formula Tool 🙂

"^([A-Z\s]*)"

This expression essentially means, "If the string starts with a capital A-Z, only has capital letters A-Z following it, and has a white space following after, then create a match.". 

 

I've attached my proposed solution to this comment. Please let me know if you need any more help or assistance!

 

RegEx-ALLCAPS_solution-DeanWest-snippet.png

 

Qiu
20 - Arcturus
20 - Arcturus

@hellyars 
  Basically same with @DeanWest but see the snapshot and sample flow.1017-hellyars.PNG

Qiu
20 - Arcturus
20 - Arcturus

@hellyars 
Thanks for the mark!👍

Labels