i am using the follwoing regular expression
(".+@.+\\.[a-z]+")
Bit it accepts #@#.com as a valid email.whats the pattere i shold use?
i am using the follwoing regular expression
(".+@.+\\.[a-z]+")
Bit it accepts #@#.com as a valid email.whats the pattere i shold use?
Here's a web page that explains that better than I can: http://www.regular-expressions.info/email.html (EDIT: that appears to be a bit out of date since it refers to RFC 2822, which has been superseded by RFC 5322)
And another with an interesting take on the problem of validation: http://www.markussipila.info/pub/emailvalidator.php
Generally the best strategy for validating an email address is to just try sending mail to it.
If somebody wants to enter non-existent email address he'll do it whatever format validation you choose.
The only way to check that user owns email he entered is to send confirmation (or activation) link to that address and ask user to click it.
So don't try to make life of your users harder. Checking for presence of @
is good enough.