<strong>//检查电话号码</strong>
public boolean checkPhone(String str){
try{
boolean flagphone = false;
if(str.matches("^0?\\d{11}$")){
flagphone = true;
}else if(str.matches("^(\\(?\\d{3,4}[-\\)])?\\d{7,8}$")){
flagphone = true;
}
return flagphone;
}catch (Exception e) {
return false;
}
}
Android校验类积累
最新推荐文章于 2021-12-10 16:04:34 发布