用到的模式有Pattern和Matcher
public static boolean isSFZHChina(String str) throws PatternSyntaxException {
//正则表达式 网上很多
String regExp = "^[1-9]\\d{5}(18|19|20|(3\\d))\\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$";
Pattern p = Pattern.compile(regExp);
Matcher m = p.matcher(str);
return m.matches();
}