Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Syntax to extract complete value before last opening parenthesis and after last comma

pradnyaraibagkar
5 - Atom

Dynamic syntax to extract complete value before last opening parenthesis and after last comma.

 

Example : from the below text, output has to be System User,

 

Ekrem Rrahni (M379753), Marie Dietrich (M022543), Suprita Mg (A566060), System User (SYSTEM)

3 REPLIES 3
Bren_Spill2
12 - Quasar
12 - Quasar

@pradnyaraibagkar - try this: .*\s(\w+\s\w+\s\(\w+\))

 

image.png

pradnyaraibagkar
5 - Atom

Thanks Bren. The below Regex is working for only few inputs.

 

Can you help with the attached file.

CoG
14 - Magnetar

Here is an alternative that takes into account all provided cases: 

.*,\s?(.*?$)|(^.*$)

Screenshot.png

The Regex checks for the last occurrence of a comma and captures all remaining text, or, if no comma exists, it just takes everything.

 

Hope this helps and Happy Solving!

Labels
Top Solution Authors