Darkqueen

  String regex = "^((13[0-9])|(14[5,7,9])|(15([0-3]|[5-9]))|(17[0,1,3,5,6,7,8])|(18[0-9])|(19[8|9])|(16[6]))\\d{8}$";
  Pattern p = Pattern.compile(regex);
  Matcher m = p.matcher(registrant_phone);  //registrant_phone  ====  电话号码字段
  boolean isMatch = m.matches();
  if (!isMatch) {
     msg.errorCode = 1;
     msg.msg = "手机号格式不正确";

  }else{

    执行方法;

        }

分类:

技术点:

相关文章:

  • 2021-11-08
  • 2021-12-28
  • 2021-10-17
  • 2021-10-29
  • 2022-02-07
  • 2021-10-19
  • 2021-11-13
猜你喜欢
  • 2021-05-17
  • 2022-02-17
  • 2021-08-14
  • 2021-09-28
  • 2021-08-26
相关资源
相似解决方案