String regex="^1[3|4|5|7|8][0-9]\\d{4,8}$";
Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(phone);
boolean isMatch = m.matches();
if(isMatch){
num=1;
} else {
Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(phone);
boolean isMatch = m.matches();
if(isMatch){
num=1;
} else {
num=0;}