public static boolean checkPhone(String phone)
{
Pattern pattern = Pattern.compile("^[1][3-8]+\\d{9}$");
Matcher matcher = pattern.matcher(phone);
if (matcher.matches())
{
return true;
}
return false;
} public static boolean checkEmail(String email)
{
Pattern pattern = Pattern.compile("^/w+([-.]/w+)*@/w+([-]/w+)*/.(/w+([-]/w+)*/.)*[a-z]{2,3}$");
Matcher matcher = pattern.matcher(email);
if (matcher.matches())
{
return true;
}
return false;
}