Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

Regex Parse

mystasz
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

mystasz
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*.

 

mystasz
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 @mystasz, 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

 

mystasz
8 - Asteroid

Amazing - thank you. Exactly what was needed. 

Labels