Re: Get Email from longtext with specific text before

811 0
Showing results for 
Search instead for 
Did you mean: 
4 - Data Explorer
4 - Data Explorer

I have a question about formulas,
I have a longtext field extracted from an Email Body and I would like to find inside this field if there is any mail marked like this :
“From :
and extract just the mail to put it in.
For information, I don’t know the line in question, it may have text after the email and the domains are not the same.
I have tried Regex but I have not succeed.


4 Replies 4

Hi there! The following REGEX should work:

REGEX_EXTRACT([YOUR TEXT FIELD], "([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\\.[a-zA-Z0-9_-]+)")

Let me know is that solves it!

Hi !
thanks for the answer is gets mails but it ignores the "From : " Tag so I got anomalies and mails I don’t want
Capture d’écran 2022-06-24 154135
.(#ERRORS are empty fields so it’s OK)

Sorry, this should match all From:

REGEX_EXTRACT({Formula 2}, "([From:+\\s]+[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\\.[a-zA-Z0-9_-]+)")
4 - Data Explorer
4 - Data Explorer

Thank you I’ll look at it today But I think there will be an issue because of the space after “From” and “:”
I have managed to do something similar with

IF(FIND("From : ", {table})>0,REGEX_EXTRACT(RIGHT(table, LEN(table)-FIND("From : ", {table})-4), "([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\\.[a-zA-Z0-9_-]+)"), "")