In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more 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