Monday, August 5, 2013

Create patter for email

public final Pattern emailAddressPattter=Pattren.compile("[a-z A-Z 0-9\\+\\.\\_\\+]{1,256}+"\\@"+"[a-z A-Z 0-9][a-z A-Z 0-9\\-]{0,64}+"("+"\\."+"[a-z A-Z 0-9][a-z A-Z 0-9\\-]{0,25}+")");

now call this method to check the email

private boolean checkMail(String emailAddress)
{
     return emailAddressPattern.matcher(emailAddress).matched();
}

0 comments:

Post a Comment