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

Parsing strings

JGHOLLAND
7 - Meteor

I have a string like "XYZ123456".  I need to parse it into "XYZ" and "1" and "23456".  Is this a regex solution?  

4 REPLIES 4
ScottLewis
10 - Fireball

Depends on what other forms the string can take. If it's always 3 characters, 1 character, 5 (or the remainder) then I would do it with substring formulas because they're easier to read and maintain. If it's something like Any number of letters, 1 Number, any number of numbers then probably easier to Regex. 

usmanbashir
11 - Bolide

@JGHOLLAND 

Are your three sections always as below? 

- 1st three characters

- 4th character

- 5th-9th character

 

If so use substring function. 

 

2024-03-28_16-12-03.png

flying008
15 - Aurora

Hi, @JGHOLLAND 

 

FYI.

([a-z]{3,})\s?(\d{1})(\d{5,})

 

录制_2024_03_29_09_38_25_547.gif

JGHOLLAND
7 - Meteor

Thanks to everyone for the help!

Labels