Regex for the below email id extraction

Hi All,

Can anyone help me to extract email id from this

From: Shreyas Borwankar - Ikonsys shreyas@ikonsys.net

From: John (john@infotekgroups.com)

I want the regex to extract mail from the above two lines? Email id may come between () or <>.

Hi @Lakshmi_Tiliconveli

Try this:

Regards

Hi @Lakshmi_Tiliconveli

Input = "From: Shreyas Borwankar - Ikonsys shreyas@ikonsys.net"

Output = System.Text.RegularExpressions.Regex.Match(Input,"[A-Za-z]+\@[A-Za-z]+\.[a-z]+").Value.Trim()

Regards

Yeah It worked . Thanks
I have multiple line text just want to extract email id from a line contains From:
Can you add this additional filter in regex let me know if that is possible.
Eg:

From: John (john@abcbcbcb.com)
Date: 05/10/24 10:27
To: helpdesk (helpdesk@xyxhxhxh.com)
Subject: Consultants Available on Bench

Hi @Lakshmi_Tiliconveli

Try this:

(?<=From.*)[A-Za-z]+\@[A-Za-z]+\.[a-z]+

Regards

Thanks @vrdabberu It worked and helped me a lot

1 Like

Glad to have helped @Lakshmi_Tiliconveli

Happy Automation!!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.