Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Regex Parse

MysticalAz
8 - Asteroid

Hi Community,

 

I'm having some trouble parsing the attached input. Expected output attached as well. Charles has multiple parses within the same row. 

I'm looking to parse anything before ",ItemBenefitReceived" and after the "| ":

 

 

Thank you!

7 REPLIES 7
ChrisTX
15 - Aurora

Try

 

.*\|\s(.*)\,\sItemBenefitReceived*.

 

the site RegEx101.com helps

MysticalAz
8 - Asteroid

Thank you, that does work. I updated my original discussion to include an example where multiple "items received" exists. If you have suggestions on this, please let me know.

rickey0830
8 - Asteroid
Just want to say thanks for posting that site! Been using Rubular, but RegEx101 seems way better!
PhilipMannering
16 - Nebula
16 - Nebula

Try @ChrisTX 's regex with a couple of question marks in it,

 

.*?\|\s(.*?)\,\sItemBenefitReceived*.

 

MysticalAz
8 - Asteroid

This does work, however, it does not work for rows where there are multiple "itemBenefitReceived" items. It parses out 1 but leaves the others. Any suggestions? My expected output is attached. 

PhilipMannering
16 - Nebula
16 - Nebula

Hey @MysticalAz, I see what you mean now.

 

You want the tokenize method in the Regex Tool. Or you can use a couple of Text-to-Columns Tools. Both are shown in the attached workflow.

 

PhilipMannering_0-1663730007691.png

 

MysticalAz
8 - Asteroid

Amazing - thank you. Exactly what was needed. 

Labels