public static boolean isPhoneNum(String s)

{

Pattern telephone = Pattern.compile("(\\d{3})-(\\d{3,4})-(\\d{4})");

Matcher m = telephone.matcher(s); 

if (m.matches()){

return true;

}

else {

return false;

   }

}

+ Recent posts