java 手机号码+邮箱的验证

import java.util.regex.Pattern; //导入的包

1:String REGEX_MOBILE = "^((17[0-9])|(14[0-9])|(13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$"; // 手机号正则

2:进行匹配
Pattern.matches(REGEX_MOBILE, projectOwner.getContactPhone())

if(Pattern.matches(REGEX_MOBILE, projectOwner.getContactPhone())){

}

  

猜你喜欢

转载自www.cnblogs.com/qq1141100952com/p/10140099.html