Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Need help RegEx Parse

elclark
8 - Asteroid

Hello,

 

I'm new to using RegEx and I'm trying to Parse a name field. The names are formatted as follows

 

Smith/John A

Doe/Jane

 

I tried using the below expression but it's not parsing any of the fields, I just get a message saying 0 records were successfully parsed and 100 were not.

 

(\d+)\W(\d+)\s(\d+)

 

Any help would be much appreciated.

Thanks.

 

 

4 REPLIES 4
fmvizcaino
17 - Castor
17 - Castor

Hi @elclark ,

 

Attached is an example showing how to get that done.

You can use both regex or text to columns to accomplish what you need, I have created both examples for you.

 

Take a look and let me know if that works for you.

Best,

Fernando Vizcaino

Thableaus
17 - Castor
17 - Castor

Hi @elclark 

 

Try the REGEX tool on Parse mode.

 

 

ParseRegexTOOL.PNG

 

(\w+)/(\w+)\s?(\w*)

 

Cheers,

elclark
8 - Asteroid

Thank you! One quick follow up, a couple of the records did not parse because the name was formatted differently, there was a space after the last name, as follows

 

Smith /John

 

What changes would i need to make to capture both scenarios with a space or no space before or after the / symbol?

Thableaus
17 - Castor
17 - Castor

@elclark 

 

(\w+)\s?/(\w+)\s?(\w*)

 

This should work with the space as well.

 

Cheers,

Labels