Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.
Free Trial

Alteryx Designer Desktop Discussions

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

REGEX PARSE PROBLEM

kpmg_lc_analyst
7 - Meteor

I'm trying to parse an 8-digit string that has "2" in the first and fourth position from a larger string.  I used Regex Pal to get this:

 

[2]\d{3}[2]\d{3}

 

but it does not work in Alteryx Regex.  What do I need to change?

Thanks,

Ben

4 REPLIES 4
NicoleJohnson
ACE Emeritus
ACE Emeritus

I believe what you want to do is create marked groups, so something like this:

 

([2])(\d{2})([2])(\d{4})

 

If the second # 2 is in the 4th position, then you'll only want 2 digits between the first instance and the second, not 3 as indicated in your RegEx Pal string.

 

Does this accomplish what you're looking for? Kindly mark solved if so, or let me know if additional tweaking is needed! Thanks!

 

NJ

Joe_Mako
12 - Quasar

Try without the brackets:

 

2\d{3}2\d{3}

 

Here is what I got:

 

match.png

NicoleJohnson
ACE Emeritus
ACE Emeritus

Scratch my first response. Looking at @Joe_Mako response and then re-reading your original question, I think this might be the combination you're looking for - a parse though, not a match, and for it to pull out just the string of 8 digits from the larger string regardless of their location in the string. Getting closer? :)

 

RegEx Example.JPG

SeanAdams
17 - Castor
17 - Castor

Hey @kpmg_lc_analyst

Did the solutions below get you to a working outcome?

 

If so - would you mind marking this as solved - or if not then let's work together to iterate to a solution that works?

 

thank you!

Sean

Labels
Top Solution Authors