sudha456
(sudhakar)
March 1, 2023, 10:24am
1
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.
sudha456
(sudhakar)
March 1, 2023, 10:25am
2
tushar.c2
(Tushar Chaudhari)
March 1, 2023, 10:28am
3
Hello,
Please try using [a-zA-Z0-9_.]+@[a-zA-Z0-9_.]+.[a-zA-Z.]+[^.hk].
Thanks
sudha456
(sudhakar)
March 1, 2023, 10:56am
4
Thanks for quick response.
its is skipping only .hk , if something is else is coming its not working.
sudha456
(sudhakar)
March 1, 2023, 11:02am
5
regex which will be skipping anything which comes after 2nd “.” would be appriciated
thanks
Gokul001
(Gokul Balaji)
March 1, 2023, 11:04am
6
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.