Start Free Trial

Alteryx Designer Desktop Discussions

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

Alteryx RegEx Tool Formula not working

BobbyQ
7 - Meteor

Hi I can't figure out why this REGEX Tool formula isnt working in Alteryx when I have tested it out with success on a regex builder program.
Not sure if REGEX_MATCH in Alteryx functions differently somehow? Essentially I am trying to get the last occurrence of a string in a concatenation delimited by spaces.


Desired result: "CK*1140*H*QK*FF*RXQ*25/32*DNDCDDL*DDDD*DDDOSPOLY*0*1111"

 

Any help would be greatly appreciated. Thank you

6 REPLIES 6
caltang
17 - Castor
17 - Castor

Instead of REGEX, why not use the Text to Columns tool and split the data by row and use space as a delimiter? 

Then, use the Tile tool and unique by your original CONCAT field, then use a sample tool to group by CONCAT field and choose LAST 1 of the values you want.

 

Based on your data, that’s what I would do.

 

Im on my phone now so I can’t build it on the fly

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
KGT
13 - Pulsar

Agree with @caltang, I would not use REGEX for this, either split and filter, or a standard formula. The only thing in that REGEX formula that means you'll get the last, is the $. REGEX_Match will only ever return a True/False, Parse would be what you are after.

 

Trim(Right([CONCAT],FindString(ReverseString([CONCAT]),'\s'))) will get you your desired result.

flying008
15 - Aurora

Hi, @BobbyQ 

 

FYI.

 

^.+\s(\S+)\s*$

 

录制_2025_09_26_14_12_26_796.gif

 

BobbyQ
7 - Meteor

Thank you! That worked perfectly

BobbyQ
7 - Meteor

That wouldnt work here since I dont know how many strings will be concatenated together since this is bringing together 6 columns and there are potentially multiple trailing and leading whitespaces. I know that wasnt shown here in the example I provided as I tried to simplify it, but that is why I needed to use RegEx

flying008
15 - Aurora

Hi, @BobbyQ 

 

^.+\s+(\S+)\s*$

 

Labels
Top Solution Authors