Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Use REGEX to find all instances of an ID that match the pattern

hellyars
13 - Pulsar

Hi,  

 

I need some help pulling IDs from a field.  The ID always matches the pattern .{2}\-.{1}\-.{3}.  But there may be more than one ID per row.  How can I extract them?  

 

I tried the following expression ^.*?(.{2}\-.{1}\-.{3}).  But it only captures the first instance of the pattern.  I need to catch all 1 or 2 instances.  

 

And the last row with IDs for Bruins and Caps is correct -- its one field (the real-world data has a unique filename, the IDs are associated with the unique filename).  

 

Blues (MO-F-ADG and MO-D-AAE)
Jets (EG-P-GKB)
Sharks (PK-D-GAI)
Stars (KS-P-AMP)
Bruins (HU-D-YAD); Caps (HU-B-UCU)
 
 
2 REPLIES 2
ConnorK
Alteryx
Alteryx

Hi @hellyars,

 

Try using the tokenize method in your Regex, and putting parenthesis around your expression. I have attached an example

 

I hope this helps!

 

Best,

Connor Kelleher
Senior Sales Engineer
Alteryx
hellyars
13 - Pulsar

Thank you.  I always just set regex to parse.  I always forget about tokenize. 

Labels