现在的位置: 首页 > 综合 > 正文

checkPhone判断手机号格式

2018年09月11日 ⁄ 综合 ⁄ 共 220字 ⁄ 字号 评论关闭
// checkPhone判断手机号格式
	public boolean checkPhone(String phone) {
		Pattern pattern = Pattern
				.compile("^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$");
		Matcher matcher = pattern.matcher(phone);

		if (matcher.matches()) {
			return true;
		}
		return false;
	}

抱歉!评论已关闭.