Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Don't forget to submit your entry for the Excellence Awards by October 30! | Need more information about the program? Check out the blog here
SOLVED

Regex

Highlighted
8 - Asteroid

Awesome that works perfect !

 

Thanks

Highlighted
8 - Asteroid

@Jonathan-Sherman Hi Jonathan, would you please help me understand the codes of below?

?.*

(^|\s)

(.*?)

Highlighted
13 - Pulsar

Hi @SciencePeak,

 

It is difficult to see in the expression, but there is a space before the ?.*    Alteryx allows a space, but I usually use \s instead as it makes the expression clearer.  So this is really two separate parts of the expression:

\s?    find the first whitespace character

.*       match everything (until the named group that follows)

 

(^|\s)      ^    beginning of line

              |     or

             \s    whitespace character

 

So the second RegEx is finding where from the beginning of the line or after a space find the word APT or FLAT or APARTMENT or Suite (all case insensitive) followed by any characters until followed by a digit or a word.  If that specific pattern is found, then replace it with blank.

 

(.*?)  in the third RegEx is a named group to find all characters until the next part of the RegEx expression.  In this case find all characters until the next named group which is one or more digits followed by a single word character if there is one

 

For more information on Perl syntax, I find this Alteryx Community link to be helpful:  

 

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/RegEx-Perl-Syntax-Guide/ta-p/1288

 

 

Highlighted
8 - Asteroid

@T_Willins Very grateful of this! Thank you!

Labels