//邮箱正则表达式
String regexEmail = “^\w+((-\w+)|(.\w+))@[A-Za-z0-9]+((.|-)[A-Za-z0-9]+).[A-Za-z0-9]+$”;
//校验手机号
String regularPhoneExpression = "^[1][3,4,5,7,8][0-9]{9}$" ;
Pattern patternPhone = Pattern.compile(regularPhoneExpression);
Matcher mPhone = patternPhone.matcher(telPhone);
if(!mPhone.matches()) {
//手机号格式不正确
。。。。
}
//校验身份证
String regularExpression = "(^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$)|" +
"(^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}$)";
Pattern patternIdentityCard = Pattern.compile(regularExpression);
Matcher IdentityCard = patternIdentityCard.matcher(identityCard);
if(!IdentityCard.matches()) {
//身份证格式不正确
。。。。
}