Need Regex to get email id from a string

Hello All,

i am trying to get email id from a string using regex.

sample email id are:

EM patrickj@graham.com.hk
em routing@jeminc.net

but need only
routing@jeminc.net” or “routing@jeminc.net”.

i tried with [a-zA-Z0-9_.]+@[a-zA-Z0-9_.]+.[a-zA-Z.]+ and ([\w.]+)@([a-z.]+)(.)([a-z]+) but still i am getting .hk at the end of the output for “EM patrickj@graham.com.hk”

but need only " patrickj@graham.com".

so could you please help me on this?

thanks in advance.

few more input string samples

EM PAWAN@DEVGIRI.COM

EM MEREDITHRILEY@NVMPET.COM
EM BRECKHILTON@TUPPERWARE.COM

Hello,
Please try using [a-zA-Z0-9_.]+@[a-zA-Z0-9_.]+.[a-zA-Z.]+[^.hk].

Thanks

Thanks for quick response.

its is skipping only .hk , if something is else is coming its not working.

regex which will be skipping anything which comes after 2nd “.” would be appriciated

thanks

HI @sudha456

You can try with Matches activity

Regards
Gokul

Hi @sudha456 ,

Kindly try this:

[a-zA-Z0-9_.]+@[a-zA-Z0-9_.]+.[a-zA-Z.]+[^a-zA-Z]

I just modified @tushar.c2 's regex.