I am using the follwoing regular expression
(".+@.+\.[a-z]+")
Bit it accepts #@#.com as a valid email. What's the pattern I should use?
See Question&Answers more detail:osI am using the follwoing regular expression
(".+@.+\.[a-z]+")
Bit it accepts #@#.com as a valid email. What's the pattern I should use?
See Question&Answers more detail:osYou should use apache-commons email validator. You can get the jar file from here.
Here is a simple example of how to use it:
import org.apache.commons.validator.routines.EmailValidator;
boolean isValidEmail = EmailValidator.getInstance().isValid(emailAddress);