Alteryx Designer Desktop Discussions

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

RegEx Parse

valeriemattas
8 - Asteroid

Hello,

 

I am using RegEx Parse to pull letters ABC from record (ABC) using the expressing .*\((.*)\).*

 

This is working, however, in the records where there is more than one set of parenthesis, it is pulling the data between the latter parenthesis, but I need the data from the first set of parenthesis. 

 

For example: 

(ABC) Alpha Bravo Charlie (123) is resulting in 123, but I want ABC.

 

Help! 🙂

Thanks,

 

Valerie 

5 REPLIES 5
AbhilashR
15 - Aurora
15 - Aurora

Hi Valerie, can you try this regex?

\((.*)\).

Attached is a sample workflow with this regex code. 

valeriemattas
8 - Asteroid

Brilliant, it worked. Thank you @AbhilashR  🙂

valeriemattas
8 - Asteroid

@AbhilashR I spoke too soon. It actually just removed the first and last parenthesis, and left me EVERYTHING in between. 

 

For example: 

(ABC) Alpha Bravo Charlie (123) 

 

\((.*)\).

Results in: 

ABC) Alpha Bravo Charlie (123

 

End goal: 

ABC

 

Thoughts?

AbhilashR
15 - Aurora
15 - Aurora

Can you include a formula before regex tool to trim blank spaces?

AbhilashR_0-1586976455277.png

I tried that and it worked for me. Let me know if this resolves the issue.

valeriemattas
8 - Asteroid

That did not work, but it prompted me to create a formula using string to pull just the first values, which worked. I will confirm with the source data that the field always begins with the first 4 characters we need. 

 

All resolved for now. Thanks for everything, @AbhilashR 

Labels