MarcoCastro
asked on
A RegEx to e-mail
Hi,
What is the pattern tha handles these two e-mail:
joe@gmail.com
joe@gmail.com.br
The patterns that I found don't handle the .br part of the string
Thanks,
Marco Castro
What is the pattern tha handles these two e-mail:
joe@gmail.com
joe@gmail.com.br
The patterns that I found don't handle the .br part of the string
Thanks,
Marco Castro
To make it a tad safer, you can exclude extra @'s:
[^\s@]+@[^\s@]+
Hope this will be useful....
string EmailPattern = @"^(([\w-]+\.)+[\w-]+|([a-zA-Z]{1}|[\w-]{2,}))@"
+ @"((([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\."
+ @"([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])){1}|"
+ @"([a-zA-Z]+[\w-]+\.)+[a-zA-Z]{2,4})$";
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window