• Instructions to Ask a Question

    For any assistance, please click the "Ask a Question" button and select the Pabbly product for which you require support.

    We offer seven comprehensive applications designed to help you efficiently manage and grow your business:

    Our support team endeavors to respond within 24 business hours (Monday to Friday, 10:00 AM to 6:00 PM IST). We appreciate your understanding and patience.

    🚀 Exclusive Lifetime Offers 🚀

    We invite you to take advantage of our special one-time payment plans, providing lifetime access to select applications:

    • 🔥 Pabbly Connect — Lifetime Access for $249View Offer
    • 🔥 Pabbly Subscription Billing — Lifetime Access for $249View Offer
    • 🔥 Pabbly Chatflow — Lifetime Access for $249View Offer

    Make a one-time investment and enjoy the advantages of robust business management tools for years to come.

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