The Alteryx Community is a finalist in three 2026 CMX Awards! Help us win Customer Support Community, Most Engaged Community, and User Group Program of the Year - vote now! (it only takes about 2 minutes) before January 9.
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

REGEX to find Acronym, that may OR may not be there

hellyars
13 - Pulsar

Hi,

 

I have Name filed.   SOME names have acronyms associated with them.  The are set off by opening and closing parentheses ().  I want to split the field into 2 new fields, one for Name and one for Acronym.  

 

Example:  

EAT MORE TACOS (EMT)
EAT MORE TACOS

 

My REGEX is set to (^.*)\s(\([A-Z].*\)).  It works if the acronym is present, but it does not work if the acronym is not present.  

 

How do I make this work?

 

Thanks,

2 REPLIES 2
Thableaus
17 - Castor
17 - Castor

Hi @hellyars 

 

Try this:

 

(.*)\s(\([^)]+\))?

 

Parse mode Regex.


Cheers,

Claje
14 - Magnetar

Hi,


Try the following RegEx:

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

 

The two changes I made are as follows:

 

I changed your "any character" search to "any character other than an open parentheses" with [^\(]* instead of .*

 

I made your second argument (the one looking for anything in parentheses) optional with a * at the end.

Labels
Top Solution Authors