I have multiple fields where I have text between tags that I want. For Example:
<span style="font-size:10.66px;">e</span><span style="font-size:10.66px;">nhancement for existing report</span>
The Result I want to get is
enhancement for existing report
The below code works except that it only delivers the first match:
<span.*?>\K(.*?)(?=<\/span>)
Searching online, it seems that adding a /g to the end should deliver me multiple matches but I cannot get it to work in Alteryx, even though it seems to work here
Any help would be appreciated
Solved! Go to Solution.
Hi @Billbisco, if you 'tokenize' your result you will get all regex parses. From there you can cross tab your data and combine it with a formula tool.
Workflow
Regex
Output
Hi
Have you considered a formula tool? Or Multi-field formula if you need to apply across several columns?
The Regex_Replace function can replace anything within the <> with nothing:
REGEX_Replace([Field1], "(<.*?>)", "")
Thank you Josh and Esther for your quick replies.
You're right Josh that I could tokenize it and then combine later. Alteryx seems to not allow it to dynamically create columns as needed. Afterall, there could be more than 2 span style tags. Crosstab I will have to look into for future applications thanks!
Esther, your formula works quite well. I'm somewhat disappointed I can't use straight up Regex with /g at the end though. But, this is elegant and in one step and I'll use it. Thanks!