Inspire EMEA 2022 On-Demand is live! Watch now, and be sure to save the date for Inspire 2023 in Las Vegas next May.

Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer 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
13 - Pulsar

You are missing a backslash before the forward slash. 

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

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

PhilipMannering
15 - Aurora
15 - Aurora

@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