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

Quick regex help please!

ck2024
9 - Comet

Hi everyone

 

I've created this

 

https://regex101.com/r/GbTLKM/1

 

 

throught help of google to parse a string with the matching output when a string contains something beginning with INT and ending in a series of numbers but I can't get it to work in the Regex tool in Alteryx

 

(INT|int).*[0-9]$ should find and parse INTCNMAN123 in the below string

 

invoice INTCNMAN123

 

Could someone tell me what I am doing wrong?

 

Thank you

3 REPLIES 3
ChrisTX
16 - Nebula
16 - Nebula

((INT|int).*[0-9]+)$

 

The string you want will be represented by $1 in Alteryx

 

The web site https://regex101.com/ is helpful to test regular expressions

ck2024
9 - Comet

Thank you for the reply - that makes sense.  It didn't quite achieve what I want but figured it out by amending it to

 

((INT|int).*[0-9]{3})

 

as I didn't want to grab anything after the first set of numbers...if I'm honest I am not sure why it works now but it does!  Regex101 website helped so thank you

 

ChrisTX
16 - Nebula
16 - Nebula

The parenthesis around the entire expression will represent a group ... group 1 ..  which is $1 in Alteryx

 

((INT|int).*[0-9]{3})

 

(INT|int)   means either "INT" or "int"

 

.*  means any character, one or more times

 

[0-9]{3}   means any number 0 to 9, exactly 3 occurrences

 

Labels