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

Help with Regex Parse

stj1120
8 - Asteroid

Hi all,

 

I'm trying to separate the data using regex parse.

 

    Column1

1. ASdfgtchbn123ADFGV8,/djvvjlvi69
2. XDfctyubjn1546

 

Some part of the data in the input is same in the two records. But, other part in first record is little different. I tried multiple approaches. 

 

I used the below pattern. 

([A-Z][a-z]+)(\d+)|([A-Z]+)(\d),/([a-z]+)(\d+) 

 

stj1120_2-1656424906103.png

 

When I use above pattern then I get the output as above. 

 

If I use the pattern like this ([A-Z][a-z]+)(\d+)([A-Z]+)(\d),/([a-z]+)(\d+) then I get the below output. 

 

stj1120_0-1656424627004.png  

 

How do I get the output data in the two records without disturbing any?

 

Please help.

 

Thank you.

 

Best regards,

teja.

 

3 REPLIES 3
gabrielvilella
14 - Magnetar

You are missing a backslash before the forward slash. 

([A-Za-z]+)(\d+)|([A-Z]+)(\d),\/([a-z]+)(\d+)
PhilipMannering
16 - Nebula
16 - Nebula

@gabrielvilella You don't need to escape a forward slash.

PhilipMannering
16 - Nebula
16 - Nebula

@stj1120 

 

This works for your two records (and probably your two records alone)

([A-Z][a-z]+)(\d+)(?:([A-Z]+)(\d),/([a-z]+)(\d+))?

 

Note that your examples start with two upper case latters and your expression matches only one: so the output will change when you untick the Case Insensitive.checkbox.

Labels