Regex Match Pattern Fallback Match

Hi there :wave:t2:

I’m stuck with one scenario that is driving me a little bit nuts :crazy_face: hopefully someone can bring some clarity here and point me in the right direction.

Here’s the scenario to give some context:

So I’m using the Match Pattern module in two occasions:

  1. Extract the item name
  2. Extract the quantity of an item

Both of them seem to work just fine when performed separately, however, when placing them one after another. The second module (quantity one) returns two operations with the exact same result.

And on top of that - it throws me a “Fallback Match” - but the values are correct. I don’t have a clue of why is that happening.

Apparently I’m using a Positive Lookahead regex and the Regex101 website is obtaining those values successfully.

My questions are:

  • Why the Output module is throwing a Fallback Match?
  • Why the Match Pattern module is generating 2 operations if the input has only one bundle?

Appreciate some help on this! Thanks folks :raised_hands:t2:

You’re confusing terms.

Output module returns 2 bundles - one for each Match. The fallback match is the name of the key for the look ahead. And the index (i) is simply the occurrence number.

It generates 2 bundles which in turn generates 2 operations. The input is not a bundle but text. The parser can generate between 0 and many bundles — that’s the whole point of the parser. You can aggregate the results of the parser with an aggregator (like an array aggregator)

Hi @alex.newpath, thank you for your reply. Appreciate it!

I’m still a bit confused, even with your explanation because I believe the second Regex Match Pattern should only consumed 1 operation and return two output modules. I’m processing the same information.

Here’s the comparison:

Match pattern 1 → Item name

Match pattern 2 → Quantity

Both of them are pointing to the exact same Spreadsheet. If I’m performing them individually, it works, but when including a module in between it consumes 2 operations. Maybe I’m missing something.

Thank you for your help

The parser returns the number of bundles for each search. Subsequent modules (bubbles) will execute each bundle at a time. If you want you can aggregate all parser results using an array aggregator into one bundle with an array of all results.

1 Like