We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Regex Challenge : Parsing out values that start with 5 numbers

waqaraphoto
7 - Meteor

Hi Everyone, 

 

In the screenshot attached, I'm trying to create a new field which contains only those Titles that start with a 5 digit number. Can anyone help me do this using regex? I've used the LEFT([String],5) function but that just gave me the left most 5 characters/numbers. I'm not sure how to apply this logic .. perhaps a regex solution can do this.

 

Thank you!

parsing ins ids.PNG

3 REPLIES 3
MarqueeCrew
20 - Arcturus
20 - Arcturus

@waqaraphoto,

 

A quick solution...

 

regex_replace([title],"(\d{5}).*",'$1')

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
waqaraphoto
7 - Meteor

That worked! @MarqueeCrew. Thanks for your help! :)

MarqueeCrew
20 - Arcturus
20 - Arcturus

@waqaraphoto,

 

I originally read this as identify and modified the solution to provide you with the 5 digit value via regex_replace.

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Labels
Top Solution Authors