community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx Knowledge Base

Definitive answers from Designer experts.

20 Token RegEx Expressions For The Newbie

Alteryx Certified Partner
Alteryx Certified Partner
Created on
PRODUCT: Alteryx Designer 
VERSION: 2018.1
LAST UPDATE: 05/09/2018 

ATTACHMENT: Regex Introduction.yxmd 


Your RegEx Journey Starts Here

 

My journey with Regular Expressions (RegEx) started because I was lazy. I realized that substring, findstring and other searches were difficult to configure when my data wasn't well structured. As I began working with more and more data I found that the time spent in learning about RegEx was saving me loads of time and was getting me cleaner data. I didn't learn it all overnight. Sometimes I needed help and I did ask for it.  

 

I see many questions in the Alteryx Community regarding patterns. Some of them I answer with RegEx and some without. Just the other day I used both the contains() function as well as the RegEx replace in the same expression for a post. The pattern used was not for a beginner and I apologized for not being able to adequately explain it. I am self-taught and sometimes I just know how to write something (learned from trial and error) and explaining the expression was difficult for me. In the following video I show you ways to identify basic target data (Tokens) and use a variety of formula replacements to demonstrate how the token finds matches throughout the string.

 

The following 20 minute video walks you through some simple replacements and hopefully provides you with the courage to explore your own data with RegEx at your side. If you want a quick reference, you can use RegEx101 to help you. I explain in the video that I prefer to use Alteryx designer, but the choice is yours to make. There are training opportunities here in community and at Inspire for you as well.

 

 

Cheers, 

Mark

Comments
Meteor

Very helpful. Thanks for creating this MarqueeCrew.

Alteryx Certified Partner
Alteryx Certified Partner

What would you like to see next?  

Meteor

I am fresh out of questions at the moment.

I am pretty sure I will run into some snags anytime soon.

I will keep you posted.

Thanks again.

 

Regards,

Pushkar 

 

P.S.  On second thought, do you blog? 

Alteryx Certified Partner
Alteryx Certified Partner
Meteoroid

This is so helpful. Thank you immensely Mark. 

Meteor

Hello @MarqueeCrew,

 

I am trying to use RegEx_Replace function in Formula tool to extract the month from a string.

But this function works more like - let us remove whatever we don't need.

 

I looked for a different function but did not find any.

I guess I should spend more time on writing better logic.

Any thoughts?

image.png

Alteryx Certified Partner
Alteryx Certified Partner

@pushkardps,

 

Does this video help?  

 

 

You can also subscribe and follow me on YouTube.  If you post your sample data and desired output, I or someone will quickly reply.  It might be that there is a datetimeformat() solution too.

 

Cheers,

Mark

Meteor

Aaah I understand where I went wrong @MarqueeCrew, the problem I am working on is a part of the weekly challenge. 

I have already seen your solution to that challenge but wanted to come up with something by myself. This helped a lot.

Thanks a ton. I will follow the youtube channel and post queries there going forward.