20gg-com
/**
* 验证电话号码
* 
* @param 待验证的字符串
* @return 如果是符合格式的字符串,返回 <b>true </b>,否则为 <b>false </b>
*/
public static boolean IsTelephone(String str) {
String regex = "^(\\d{3,4}-)?\\d{6,8}$";
return match(regex, str);
}

 

分类:

技术点:

相关文章:

  • 2021-11-01
  • 2022-12-23
  • 2021-12-05
  • 2021-11-11
  • 2021-11-11
  • 2021-11-12
  • 2022-12-23
  • 2021-07-09
猜你喜欢
  • 2021-11-11
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
  • 2021-10-07
相关资源
相似解决方案