首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

java兑现移动,联通,电信手机号码的验证

2013-07-08 
java实现移动,联通,电信手机号码的验证import java.io.IOExceptionimport java.util.regex.Matcherimpor

java实现移动,联通,电信手机号码的验证
import java.io.IOException;import java.util.regex.Matcher;import java.util.regex.Pattern; public class ClassPathResource { public static boolean isMobileNO(String mobiles){ Pattern p = Pattern.compile("^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$"); Matcher m = p.matcher(mobiles); System.out.println(m.matches()+"---"); return m.matches(); } public static void main(String[] args) throws IOException { System.out.println(ClassPathResource.isMobileNO("13245184639")); } }

?

热点排行