Text parser's 'Match pattern' and 'Replace' operations failing to capture/separate groups from Google Gemini AI output


Detailed Problem Description for Make.com Community

Subject: Text parser’s ‘Match pattern’ and ‘Replace’ operations failing to capture/separate groups from Google Gemini AI output

Hello everyone,

I am facing a persistent and frustrating issue with the Make.com Text parser module, and I would appreciate any insight or solutions the community might have.

Scenario Overview: My scenario is designed to take a user query, send it to Google Gemini AI to generate a response, split that response into two parts, and then use those parts for image generation (Stability AI) and a webhook response.

The flow is structured as follows: Webhooks -> Google Gemini AI -> Text parser -> Tools (Set multiple variables) -> Stability AI -> Webhooks Response

Module 1: Webhooks

  • Receives a search_query (e.g., “Volcano”).

Module 2: Google Gemini AI

  • The prompt is configured to generate a single response that includes two distinct sections with specific headings.
  • Gemini Output: The output from the Gemini module’s Result is a single long string, but it consistently contains the following structure:**Image Description:** [text for the image goes here] **Mnemonic Story & Explanation:** [text for the mnemonic story goes here]
    • Example of the actual output format: "**Image Description:** A majestic volcano erupts, spewing fiery orange lava down its dark, rugged slopes. Thick, grey ash clouds billow into a dramatic sky... **Mnemonic Story & Explanation:** VOLCANO** **V**ent: Imagine a giant underground pipe..."
    • Note: I have tried structuring the Gemini input with two separate “Parts” in the Messages array (one for the image description and one for the mnemonic explanation), but Gemini still returns a single, combined string as the Result for both inputs.

Module 3: Text parser (The problem module)

  • Goal: My goal is to split the single Gemini output string into two separate text variables: one for the Image Description and one for the Mnemonic Story.
  • Attempt 1: Match pattern
    • Operation: Match pattern
    • Source text: {{2.Result}}
    • Pattern used: \*\*Image Description:\*\*([\s\S]*?)\s*\*\*Mnemonic Story & Explanation:\*\*([\s\S]*)
    • Problem: After the module runs and turns green, the output bundle (Bundle 1: (Collection)) still contains the entire combined text under Text (Long String). When I try to map the variables in the subsequent “Tools” module, the captured groups (1 and 2) do not appear in the list of mappable items under the Text parser’s output. They are simply not there to be selected, despite the RegEx being correct. A user in a similar thread had a screenshot showing 1 and 2 as mappable items, but they are not visible in my mapping menu.
  • Attempt 2: Replace
    • Operation: Replace
    • Pattern used (for Image Description): \*\*Image Description:\*\*([\s\S]*?)\s*\*\*Mnemonic Story & Explanation:\*\*[\s\S]*
    • Replacement: $1
    • Problem: This also failed. The output from the module still contained the entire combined text string, not just the captured group 1. I tried the same logic for the Mnemonic text (\*\*Mnemonic Story & Explanation:\*\*(.*)) with no success.

Summary of the issue: The Make.com Text parser is not correctly capturing or separating the text from the Gemini output using standard RegEx capturing groups, and the mapped variables (1, 2) are not available for selection in the next module’s mapping menu, even though the module runs without error.

Question: Has anyone encountered this specific issue with the Text parser and Gemini AI? Is there a known bug or a recommended workaround? How can I reliably split this text into two separate, mappable variables?



When reaching out for assistance with extracting text, it would be super helpful if you could share the actual text you’re trying to match. Screenshots of text can be a bit tricky, so if you could copy and paste the text directly here, that would be awesome! It ensures we can run it against test patterns effectively. If there’s any sensitive info, feel free to change it to something fictional yet still valid by keeping the format intact.

Providing clear text examples saves time on both ends and helps us give you the best possible solution. Without proper examples, we might end up playing a guessing game, and nobody wants that as it is a waste of time! You are more likely to get a correct answer faster. So, help us help you by sharing those text snippets.

Please format the example text this way to preserve line breaks and special characters:

Here are some ways to provide text content in a way that it won’t be modified by the forum.

  • Method 1: Type code fence manually
    Add three backticks ``` in a separate line before and after the content, like this,

    ```
    text goes here
    ```
    
  • Method 2: Highlight and click the “preformatted text” button in the editor

  • Method 3: Upload your file and share the public link
    (this method is only recommended for large files exceeding the forum upload limit)

If you need further assistance, please provide the following:

Could you go to regex101.com, paste in your Pattern at the top and paste a complete/full example text you are trying to match from below it?

Then, save the regex example and share the link with us here.

This will allow others to assist you here with your pattern. Thanks!

@samliew