Multiple Regex out of Email Webhook

Hello everyone,

I have an email webhook and would like to extract all the data once. It is a form that is sent and sends me the data, I would like to put the data into a Google Sheet, but somehow it doesn’t work yet. The following data comes in:

Gesendet am: Fr., 24.01.2025 - 16:59

Gesendet von: Gast

Gesendete Eingaben:

Vorname
vorname

Name
nachname

Straße, Nr
straße

PLZ
plz

Ort
ort

E-Mail
email@mail.de [email@mail.de]

Telefon
telefon [tel:telefon]

Firma
firma

Funktion
funktion


Art des Betriebes
Kantine

Anzahl der Plätze
132

Art der Maschine
siebträ

Bedarf monatlich in Liter
51-100 Liter

Gebindegröße
1 Liter Paket

Bei diesem Großhändler bestelle ich
metro


Hiermit stimme ich zu gelesen und zur Kenntnis genommen.
Ja

Ich habe die Datenschutzerklärung 
gelesen.
Ja

And this is the regex I use:

Vorname\s(?<Vorname>[^\n]+)|Name\s(?<Name>[^\n]+)|Straße, Nr\s(?<Strasse_Nr>[^\n]+)|PLZ\s(?<PLZ>[^\n]+)|Ort\s(?<Ort>[^\n]+)|E-Mail\s(?<Email>[^\n]+)|Telefon\s(?<Telefon>[^\n]+)|Firma\s(?<Firma>[^\n]+)|Funktion\s(?<Funktion>[^\n]+)|Art des Betriebes\s(?<Art_des_Betriebes>[^\n]+)|Anzahl der Plätze\s(?<Anzahl_der_Plaetze>[^\n]+)|Art der Maschine\s(?<Art_der_Maschine>[^\n]+)|Bedarf monatlich in Liter\s(?<Bedarf_monatlich_in_Liter>[^\n]+)|Gebindegröße\s(?<Gebindegroesse>[^\n]+)|Bei diesem Großhändler bestelle ich\s(?<Grosshaendler>[^\n]+)|Hiermit stimme ich zu(?:.*?zur Kenntnis genommen\.)\s(?<Datenschutz_Zustimmung>Ja)|Ich habe die Datenschutzerklärung(?:.*?\.)\s(?<Datenschutz_Gelesen>Ja)

But unfortunately that’s all that comes out:

What am I doing wrong? Can anyone help me?

is there no one who has any idea? :smiling_face_with_tear:

Hello @Jens,

I tried on my side, and your regex works. But, I just copied/pasted your text extraction; maybe there are some special characters in the original data that prevents the parsing from going well.
Or maybe you didn’t set the search as Global. See my screenshot:

I get this

So, in your scenario, check in the logs the source of what you get from the Mailhook. Use “download output”, and see whether there are hidden characters that could make the regex fail.

Now, even if you manage to make it work, there will be a caveat. Since you are using an OR (pipe) parameter, the module will returns mutliple bundles (like in my previous screenshot); which will be tricky to properly group in a single document. You can use one of the aggregators, but the result will be complex, and you might struggle to extract the info.
If BY CHANCE the format of the text you parse is always in the same “order” (vorname, nachname, strasse, plz, …), I would sugest that you adapt your regex so that you don’t use OR at all. If you do this, it will return only one bundle with all named groups as fields.

but first, try and check the format of your source data.

Let me know the outcome.

Cheers,

Benjamin

3 Likes