// checkPhone判断手机号格式
public boolean checkPhone(String phone) {
Pattern pattern = Pattern
.compile("^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$");
Matcher matcher = pattern.matcher(phone);
if (matcher.matches()) {
return true;
}
return false;
}
转载于:https://www.cnblogs.com/anjon520/p/3249910.html