Google Sheet + Text parser / regex

Hello,

I need help extracting content from an email. I think my regex might be incorrect.

Here is the email content:

Bonjour,
Nous avons reçu une demande d’informations pour votre centre - 26579 City
Formation souhaitée : Formation à Chat GPT et à l’IA
Modalité : Non défini
Demandeur : John Doe
Statut : Salarié en poste
Email : john@email.fr
Téléphone : 0609060906
Niveau de formation : BAC +3
Mode de validation : Sms
Type de demande d’information : Inconnu
Message du candidat : Bonjour, Je souhaite avoir plus de renseignements sur cette formation. Merci.
Pour une mise en relation efficace, nous vous conseillons de donner suite à cette demande dans un délai de 48h.
À bientôt sur MaFormation.

I want to extract : Formation souhaitée / Demandeur / Email / Téléphone

Here’s my regex:
Formation souhaitée : (?<formation_souhaitee>.+?)\s+Demandeur : (?[\w\s]+)\s+Email : (?[\w.-]+@[\w.-]+.\w+)\s+Téléphone : (?\d{10})

And here are the screenshots of my scenario:

I have no idea what I should do.
Thank you for your help

Welcome to the Make community!

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

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.

Hello,

thank you for your answer.
Here is the link : regex101: build, test, and debug regex

Welcome to the Make community!

You can use a Text Parser “Match Pattern” module with this Pattern (regular expression):

Formation souhaitée : (?<formation_souhaitee>.+)[\w\W]+?Demandeur : (?<demandeur>.+)[\w\W]+?Email : (?<email>.+)[\w\W]+?Téléphone : (?<telephone>.+)

Proof https://regex101.com/r/sCoyiZ/1

Important Info

  • :warning: Global match must be set to NO!

For more information, see Text Parser in the Make Help Center:

Match Pattern
The Match pattern module enables you to find and extract string elements matching a search pattern from a given text. The search pattern is a regular expression (aka regex or regexp), which is a sequence of characters in which each character is either a metacharacter, having a special meaning, or a regular character that has a literal meaning.

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.

2 Likes

Thank you it works !
So I have to improv my regex knowledge.