Regex finding leading, trailing and double or more spaces
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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!
Solved! Go to Solution.
- Labels:
- Regex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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:
Best regards
Phil
 
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
The match function is comparing the whole string so try:
Leading: ^\s+.*
Trailing: .*\s+$
Contains: .*\s{2,}.*
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks! this works!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks this works!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You answered exactly as I was about to do the same.
Cheers,
Mark
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
