Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
ALTER.NEXT:

Join us on Dec 2 for a half-day virtual analytics + data science event!
US & CA customers only

SAVE YOUR SPOT
It's the most wonderful time of the year - Santalytics 2020 is here! This year, Santa's workshop needs the help of the Alteryx Community to help get back on track, so head over to the Group Hub for all the info to get started!
SOLVED

Regex finding leading, trailing and double or more spaces

Highlighted
Alteryx Partner

Hi All,

 

I'd like to request your support to understand what's wrong with the way I'm using the RegEx tool. I'm tring to find the leading, trailing and double or more spaces in a string. I've tested the regular expressions and seems to be working fine but, these does not work in Alteryx.

 

Best!

Highlighted
Alteryx
Alteryx

Hi @garaya ,

 

one of the cool thing about Alteryx is simplifying everything. You don't need complicated RegEx for this, just use the Data Cleansing Tool:

 

screenshot.png

 

Best regards

Phil

Highlighted
Alteryx Partner

Hi Phil,

 

Thanks, I know the Data cleansing tool can help me to remove the whitespaces. However, in this case I just need to pin point the errors, is more related to metrics.

 

Best regards,

Gustavo

Highlighted
Alteryx
Alteryx

ah got it - please find the solution attached.

 

Have a great day

Phil

Highlighted
16 - Nebula
16 - Nebula

The match function is comparing the whole string so try:

 

Leading: ^\s+.*
Trailing: .*\s+$
Contains: .*\s{2,}.*

 

 

Highlighted
Alteryx Partner

Thanks! this works!

Highlighted
Alteryx Partner

Thanks this works!

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

@jdunkerley79 ,

 

You answered exactly as I was about to do the same.

 

Cheers,

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Labels