Alteryx Designer

Find answers, ask questions, and share expertise about Alteryx Designer.

Regex won't parse more than 1 digit before string condition

5 - Atom

Hello all,


I'm really new to Alteryx and Regex, and I'm having trouble parsing a pack quantity out of a description field.  Here's my current expression:




Here's the expected result:                                 But here's the output I'm getting:

Description Field       Parsed Field                      Description Field       Parsed Field    

Beer 12PK                12                                       Beer 12PK                2

Stout 4PK IPA            4                                        Stout 4PK IPA           4


I thought the + sign after the /d was supposed to capture one or more digits, but it looks like regex just continues once it finds at least one digit before the string, and then stops counting.  How do I get it to capture any amount of digits before the "PK" abbreviation?


9 - Comet

Try setting your RegEx tool to parse and use the following expression (\d+)PK

5 - Atom

Well that was easy, I didn't realize regex defaulted to putting wildcards around whatever your expression is.


Do you know why it wasn't behaving the same the way I originally had it?


Either way thank you so much!!