Extract Multiple Variables Using Text Parser & Regex

I’m trying to parse an email using the Text Parser (Match Pattern) module with the extraction of multiple variables.

Here’s sample text that’s being evaluated:
A customer has left you feedback from their order. CUSTOMER 2494157 SENT FEEDBACK

Order Number 6669 Customer Email ddsfsf98@gmail.com Customer Name Jane Smith Comments Star Rating 5

Here’s the regex I’m using:

(?<email>(?<=Email )([\s\S]*?)(?= Customer))|(?<order>(?<=Order Number )([\s\S]*?)(?= Customer))|(?<name>(?<=Customer Name )([\s\S]*?)(?= Comments))|(?<comments>(?<=Comments )([\s\S]*?)(?=Star))|(?<rating>(?<=Star Rating )([\s\S]*?)(?= -))

When I run the module, it’s only returning the order group (which is the first one found in the string). I’ve tried using the Global Match yes option but that results in an error due to an infinite loop.

What am I doing wrong? It validates fine in testers. Just not returning all of the values in Make.

Not sure it that particular regex is supported by Make, Can you check it and see if it is valid regex for ECMAScript?

Actually the regex in the original post (now edited) had an error. This is the regex that validates in ECMAScript but only pulls one value in Make:

(?<email>(?<=Email )([\s\S]*?)(?= Customer))|(?<order>(?<=Order Number )([\s\S]*?)(?= Customer))|(?<name>(?<=Customer Name )([\s\S]*?)(?= Comments))|(?<comments>(?<=Comments )([\s\S]*?)(?=Star))|(?<rating>(?<=Star Rating )([\s\S]*?)(?= -))

I understand you problem. I have faced the same issue. You need to use this Match Pattern Advance module.

1 Like