• Instructions to Ask a Question

    Click on the "Ask a Question" button and select the application for which you would like to ask questions.

    We have 5 different products namely - Pabbly Connect, Pabbly Subscription Billing, Pabbly Email Marketing, Pabbly Form Builder, Pabbly Email Verification.

    The turnaround time is 24 hrs (Business Hours - 10.00 AM to 6.00 PM IST, Except Saturday and Sunday). So your kind patience will be highly appreciated!

    🚀🚀Exclusive Discount Offer

    Just in case you're looking for any ongoing offers on Pabbly, you can check the one-time offers listed below. You just need to pay once and use the application forever -
     

    🔥 Pabbly Connect One Time Plan for $249 (🏆Lifetime Access) -  View offer 

    🔥 Pabbly Subscription Billing One Time Plan for $249 (🏆Lifetime Access) - View offer

RegEx: Extracting Email via Text Formatter > Extract Pattern

clsops

Member
Hello Pabbly Staff,

Problem: I am unable to extract email via RegEx
Goal: Extract email and forward the email body to said email

1. Tawk chat transcript is received through Email Parser.
2. I would like to extract the email
3. Forward the transcript to the email extracted from step 2

I tried the two expressions below at RegExr: https://regexr.com/ - however, neither match.
Code:
^([\sa-z\d\.-]+)@([a-z\d-]+)\.([a-z]{2,8}\s)(\.[a-z]{2,8}\s)?$
Code:
^([a-z\d\.-]+)@([a-z\d-]+)\.([a-z]{2,8})(\.[a-z]{2,8})?$
Code:
Conversation started on Tuesday, February 15 2022, 15:48 ================================================================ [15:48] Visitor navigated to Visitor navigated to [15:50] 4-8PM SHIFT (TEST) : [email protected] [15:50] Customer Support (System Message) : Hello, thank you for your visit.

As a temporary solution, I tried to use Body Html > Text Parser :
After:
Code:
<a href="mailto:
Before:
Code:
">
This can extract the first email, but not any other emails contained in the text.

For Staff, my workflow is: https://connect.pabbly.com/workflow/mapping/IjI1NTk5NyI_3D
 

Praveen

Member
@clsops Try this expression:

\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b

1645494478621.png
 

clsops

Member
\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b

Hi Praveen, it didn't work for me. Can you try testing with this text body to see if it works for you:
Code:
Conversation started on Tuesday, February 15 2022, 15:48 ================================================================ [15:48] Visitor navigated to Visitor navigated to [15:50] 4-8PM SHIFT (TEST) : [email protected] [15:50] Customer Support (System Message) : Hello, thank you for your visit.
 

Fagun Shah

Well-known member
Hi Praveen, it didn't work for me. Can you try testing with this text body to see if it works for you:
Code:
Conversation started on Tuesday, February 15 2022, 15:48 ================================================================ [15:48] Visitor navigated to Visitor navigated to [15:50] 4-8PM SHIFT (TEST) : [email protected] [15:50] Customer Support (System Message) : Hello, thank you for your visit.
Try this - ([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)
 

Fagun Shah

Well-known member
Hi Praveen, it didn't work for me. Can you try testing with this text body to see if it works for you:

Try this - ([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)
Or here is another one -

[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?
 
P

Pabblymember11

Guest
Hey @clsops

To extract email addresses from the text you can use " Text Formatter by Pabbly: Text (Basic Formatting) ".

2022-02-22_10h24_05.png
 

clsops

Member
To extract email addresses from the text you can use " Text Formatter by Pabbly: Text (Basic Formatting) ".
OMG! Thank you, Supreme! This is so much simpler!

Thank you for your help as well Fagun, appreciate your input!
[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])
^ This one is perfect, it can extract full email and all of them!
Try this - ([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)
^ PS This one does not work properly, for example, "[email protected]" > "[email protected]"
 

Praveen

Member
@clsops @Fagun Shah

Hi Praveen, it didn't work for me. Can you try testing with this text body to see if it works for you:
Code:
Conversation started on Tuesday, February 15 2022, 15:48 ================================================================ [15:48] Visitor navigated to Visitor navigated to [15:50] 4-8PM SHIFT (TEST) : [email protected] [15:50] Customer Support (System Message) : Hello, thank you for your visit.

Yes, the expression I posted worked for me. But remember there are many flavors of regex and you might need to modify it slightly depending on where you are using it. But for this particular case, the solution posted by @Supreme is supreme. 😅

1645541533344.png
 
Top