Free Trial

Alteryx Designer Desktop Discussions

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

REGEX for multiple outputs

jake8281
8 - Asteroid

I have sample data I am trying to have the first 5 digits in a reg 1(12345) and  in reg 2 I am trying to have (12345-123456). But I get Blank in Reg 1 and I get the values for reg 2.

How can I have the 2 columns together can someone fix my expression 

Spoiler
 

image.pngimage.pngimage.png

6 REPLIES 6
ChrisTX
16 - Nebula
16 - Nebula

If the string doesn't vary in length, just use the LEFT function    String Functions (alteryx.com)

 

Chris

flying008
15 - Aurora

Hi, @jake8281 

 

Try this:

 

((\d{5})-\d+)
k0pik0
6 - Meteoroid

set the first parse to (\d{5})

jake8281
8 - Asteroid

@flying008 It worked! Can you give me breakdown how you made it work or what I did wrong in my expression 

flying008
15 - Aurora

Hi, @jake8281 

 

The greedy mode is advanced with 'or' expression in regex default option, so you can try again: (\d{5}-\d+)|(\d{5})

jake8281
8 - Asteroid

@flying008 The greedy mode helped me out alot. Thank you so marked groups within marked group will have columns for smaller group and the bigger group at the same time 

Labels
Top Solution Authors