读书人

判断是不是是手机

发布时间: 2012-07-19 16:02:19 作者: rapoo

判断是否是手机

/** * 判断是否是手机 * @param tel 电话号码 * @author chitianxiang $Feb 4th, 2012 */static private boolean isMobile(String tel) {boolean matchFlag = false;if (null != tel && !"".equals(tel)) {//手机号码,以1开始,13,15,18,19,为合法,后跟9位数字String regEx="[1]{1}[3,5,8,6]{1}[0-9]{9}";matchFlag = Pattern.compile(regEx).matcher(tel).find();}return matchFlag;}
?

读书人网 >开源软件

热点推荐