Alteryx Designer Desktop Discussions

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

Regex formula for string outside brackets

Suhailpasha
5 - Atom

I've multiple data columns containing data in given format below, need help with regex formula expression for formula tool using which I can select data before brackets

I know this can be achieved individually using regex or text to columns tools, but I want to process it in one go 

 

eg: 

input Output
  
Apple (1234)Apple
Barking Dog (2134)Barking
Grumpy Cat (981901)Grumpy Cat

 

Any help would be appreciated!.

Thanks in Advance.

 

Regards,

Suhail 

3 REPLIES 3
MarqueeCrew
20 - Arcturus
20 - Arcturus

@Suhailpasha ,

 

a simple expression:

 

regex_replace([stuff], "(.*?)\s*\(.*", '$1')

 

 

 cheers,

 

 mark

 

 regex101.com

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Suhailpasha
5 - Atom

 

It worked.

Thank you Mark!!

messi007
15 - Aurora
15 - Aurora

@Suhailpasha,

 

Please see below : 

 

messi007_0-1647959040641.png

 

Attached the workflow,

Regards,

Labels