Alteryx Designer Desktop Discussions

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

Regex finding leading, trailing and double or more spaces

garaya
7 - Meteor

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!

7 REPLIES 7
PhilippK
Alteryx Alumni (Retired)

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

garaya
7 - Meteor

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

PhilippK
Alteryx Alumni (Retired)

ah got it - please find the solution attached.

 

Have a great day

Phil

jdunkerley79
ACE Emeritus
ACE Emeritus

The match function is comparing the whole string so try:

 

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

 

 

garaya
7 - Meteor

Thanks! this works!

garaya
7 - Meteor

Thanks this works!

MarqueeCrew
20 - Arcturus
20 - Arcturus

@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 restart. Order shall return.
Please Subscribe to my youTube channel.
Labels