Alteryx Designer Desktop Discussions

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

Extract substring from string with no delimiters

mpeggielycetts
5 - Atom

With one of the platforms that I work with, the data extracts are often messy. I am looking to extract an ID from within a string with no delimiters present.

 

Example string: "Matthew(10/10/2000)FarmX1234-56789-01234DogsAndCats"

Example substring for extraction: "X1234-56789-01234"

 

The format is letter,number{4}-number{5}-number{5}, so not always "X" to begin with.

 

I presume this is RegEx but not entirely sure how to use it for this case.

 

Any help would be greatly appreciated, thanks!

3 REPLIES 3
FinnCharlton
13 - Pulsar

Hi @mpeggielycetts , here's the RegEx you need:

 

image.png

 

Hope it helps!

DataNath
17 - Castor

Hey @mpeggielycetts, great that you've provided the exact pattern here - definitely one for RegEx. If you drag a RegEx tool into your workflow and put it in Parse mode, you ought to be able to use this expression to extract the necessary data:

 

([A-Z]\d{4}-\d{5}-\d{5})
ShankerV
17 - Castor

Hi @mpeggielycetts 

 

One way of doing this.

 

 

Screenshot 2023-08-25 154501.jpg

Screenshot 2023-08-25 154701.jpg

 

Many thanks

Shanker V

Labels