Do you use Alteryx in a language other than English? If so, we want to hear from you! Please help us improve the international experience of our products by participating in this 5 minute survey.

We are updating the requirements for Community registration. As of 7/21/21 all users will be required to register a phone number with their My Alteryx accounts. If you have already registered, you will be prompted on your next login to add your phone number.

Alteryx Designer Discussions

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

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

hellyars
12 - Quasar

 

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
17 - Castor

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

Qiu
17 - Castor

@hellyars 
Thanks for the mark!👍

Labels