The Alteryx Community is a finalist in three 2026 CMX Awards! Help us win Customer Support Community, Most Engaged Community, and User Group Program of the Year - vote now! (it only takes about 2 minutes) before January 9.
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
解決済み

Regex Parse

mystasz
アステロイド

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件の返信7
ChrisTX
16 - Nebula
16 - Nebula

Try

 

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

 

the site RegEx101.com helps

mystasz
アステロイド

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
アステロイド
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
アステロイド

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
アステロイド

Amazing - thank you. Exactly what was needed. 

ラベル
トップのソリューション投稿者