码迷,mamicode.com
首页 > 编程语言 > 详细

java电话号验证

时间:2017-06-19 18:36:18      阅读:149      评论:0      收藏:0      [点我收藏+]

标签:main   mat   throw   str   stat   row   string   match   []   

public static void main(String args[]) throws Exception {

  Pattern p = Pattern.compile("^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$");

   Matcher m = p.matcher("15811566026"); System.out.println(m.matches()+"---");

}

java电话号验证

标签:main   mat   throw   str   stat   row   string   match   []   

原文地址:http://www.cnblogs.com/Ming-Yang-Xu/p/7049757.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!