community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

RegEx: Get Repeated Parse Matches

Meteor

I have multiple fields where I have text between tags that I want.  For Example: 

 

 

<span style="font-size&#58;10.66px;">e</span><span style="font-size&#58;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

Highlighted
Bolide

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

Workflow.PNG

 

Regex

regex.PNG

 

Output

result.PNG

 

 

Pulsar

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], "(<.*?>)", "")
image.png

Bolide

Here is the cross tab and formula

 

Workflow

workflow crosstab.PNG

 

Crosstab

crosstab.PNG

 

Output

result crosstab.PNG

Meteor

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!

Labels