Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Regex - Fix names without removing space between names

BigDataGeek
8 - Asteroid

Hi,

 

I'm trying to fix a field for names.  Currently its displayed as:  635;#John Do and I need it formatted as 'John Do'.  There are multiple names and they all appear to have a '#' right before the actual name.

 

When I used RegEx \W it removed all white space and make it 'JohnDo'.

 

What is another method I could use?

 

Thanks

6 REPLIES 6
Kenda
16 - Nebula
16 - Nebula

Hey @BigDataGeek, this is what I used. See if it works for you, too.

 

REGEX_Replace([Field1], "(.*\#)(.*)", "$2")

BigDataGeek
8 - Asteroid

Hi, I'm having problems getting that to work, likely due to an understanding of how to insert it into my workflow.

 

I added a formula then entered that into the expression, but the output was exactly as the input.

Kenda
16 - Nebula
16 - Nebula

When I run the attached workflow, I just get 'John Do' as the output in the Browse. Are you getting this as well?

BigDataGeek
8 - Asteroid

I'm on version 10.6 and unable to open the workflow.  

 

Could you explain or screenshot how you added it to your workflow so I can double check I'm doing this right?

 

S1.png

Kenda
16 - Nebula
16 - Nebula

Oh, I see. Try adding the expression I posted previously in a normal Formula tool.

 

 

regex name #.PNG

BigDataGeek
8 - Asteroid

This worked with the formula function.  Thanks for your help!

Labels
Top Solution Authors