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

Extract number from String

daniele_zatti
7 - Meteor

Hi - I'm looking to extract from a string any 7-digit number sequence using RegEx.

 

Here are two example:

 

TEST 1234567 1608-3108                       ==>          1234567

 

TEST22 MOD.6_7894561_JUNE 23'       ==>         7894561

 

Thanks,
Daniele

15 REPLIES 15
caltang
17 - Castor
17 - Castor

In case you need my workflow, PFA. Hope this helps @daniele_zatti 

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
daniele_zatti
7 - Meteor

Perfect, works smooth now!

daniele_zatti
7 - Meteor

@caltang ... see below... i would like to capture only the strings that have exactly 7 digits (no more and no less)... on line 1 it should take 1234567... ideas?

screen.png

caltang
17 - Castor
17 - Castor

Can I have the data.... hard to extract from an image.

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
caltang
17 - Castor
17 - Castor

Nevermind, I've thought of something that incorporates REGEX and other tools as well:

image.png

 

Basically, we use Data Cleasning and REGEX to standardize your data, then use a length as filter to get what you want. Hope this helps @daniele_zatti 

 

Kindly mark it as an accepted solution as well if it helped.

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
Suzann_Pillion
5 - Atom

Thank you SO MUCH!  This was exactly the answer I needed to extract the first 5 digit number in a text string!  Very helpful!  

Labels
Top Solution Authors