On 6 October 2011 15:12, Chris <crehb...@gmail.com> wrote:
> This regex pattern should match email addresses:
>
> [A-Za-z0-9_]+([-+.'][A-Za-z0-9_]+)*@[A-Za-z0-9_]+([-.][A-Za-z0-9_]+)*\.[A-Za-z0-9_]+([-.][A-Za-z0-9_]+)*
>

Regex is a bad way to validate an email address. You risk to run out
of resources (some very long regexes), annoying people with real but
weird email addresses and people will still register using throw away
email accounts.

If you need to know for sure that email is valid, make 2 step
registration with a link sent to said email address with one-time ID'd
link back to your validator.

If however you don't run a bank or serious commercial operation, take
pretty much any email thrown at you and your emailer should remove
bouncing ones from its database.

Please read the following:

http://www.regular-expressions.info/email.html
http://www.codinghorror.com/blog/2005/02/regex-use-vs-regex-abuse.html
http://stackoverflow.com/questions/201323/what-is-the-best-regular-expression-for-validating-email-addresses
http://fightingforalostcause.net/misc/2006/compare-email-regex.php

-- 
Daniel Drozdzewski

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to