flutter验证手机号码

版权声明:本文为博主原创文章,转载请注明。 https://blog.csdn.net/qq_34698126/article/details/80986962
///大陆手机号码11位数,匹配格式:前三位固定格式+8位任意数
/// 此方法中前三位格式有:
/// 13+任意数 * 15+4的任意数 * 18+14的任意数 * 17+9的任意数 * 147
static bool isChinaPhoneLegal(String str) {
  return new RegExp('^((13[0-9])|(15[^4])|(166)|(17[0-8])|(18[0-9])|(19[8-9])|(147,145))\\d{8}\$').hasMatch(str);
}

猜你喜欢

转载自blog.csdn.net/qq_34698126/article/details/80986962