I've done some basic regex in Alteryx in the past, but I'm struggling with getting this to work. Below is an example string. What I want to do is extract the four 7 digit numbers in red.
The structure of the strings will always be the same, only the 7 digit numbers will change.
I appreciate any help I can get! Thanks!!
;2945129;;;;evar23=pdp|evar30=0|evar44=product,;3673902;;;;evar23=recommendations:pdp,;3879392;;;;evar23=recommendations:pdp,;2573384;;;;evar23=recommendations:pdp
Solved! Go to Solution.
This is a pretty brittle RegEx but I think it does what you need :)
;(\d\d\d\d\d\d\d);.*,;(\d\d\d\d\d\d\d);.*,;(\d\d\d\d\d\d\d);.*,;(\d\d\d\d\d\d\d);.*
If you use the Parse method in the RegEx tool it will split into four columns.
This specifically only works for 7 digit numbers. You could replace the \d\d\d\d\d\d\d with \d+ if you can have different length values, as long as the semicolon and comma values always exist in the correct places.
Hey @rhyatt!
I was able to extract the four sets of numbers with one Formula tool. I created 4 new fields, one for each of the sequences:
1st set:
REGEX_Replace([Field1], ".(\d{7}).*", "$1")
2nd set:
REGEX_Replace([Field1], ".(\d{7}).*?(\d{7}).*", "$2")
3rd set:
REGEX_Replace([Field1], ".(\d{7}).*(\d{7}).*(\d{7}).*", "$2")
4th set:
REGEX_Replace([Field1], ".(\d{7}).*(\d{7}).*", "$2")
Hope this helps!
Perfect! Way more simple than I thought!!