private static String 中文 = "^[\u4e00-\u9fa5]+$";
private static String 英文 = "^[A-Za-z]+$";
private static String 数字 = "^\\d+$";
private static String 整数 = "^[-\\+]?\\d+$";
private static String 实数 = "^[-\\+]?\\d+(.\\d+)?$";
private static String 邮件 = "^[a-zA-Z0-9_]+@[a-zA-Z0-9_]+.[a-zA-Z]{2,5}?((.cn)|(.jp))?$";
private static String 邮件2 = "^$";
private static String 网址 = "^http:\\/\\/[A-Za-z0-9]+.[A-Za-z0-9]+[-\\/=?%&_~`@\\[\\]\':+!]*([^<>\"\"])*$";
private static String 电话 = "^((\\(\\d{3}\\-\\))?(\\(0\\d{2,3}\\)|0\\d{2,3}-))?[1-9]\\d{6,7}$";
private static String 手机 = "^((\\(\\d{3}\\))|(\\d{3}\\-))?((13)|(15))\\d{9}$";
private static String 货币 = "^\\d+(\\.\\d+)?$";
private static String 邮编 = "^[1-9]\\d{5}$";
private static String ××× = "^\\d{17}[x0-9]$";
private static String QQ = "^[1-9]\\d{4,8}$";
public static void main(String[] args) {
// System.out.println("张三验证中文为:"+"张三".matches(中文));
// System.out.println("zhang验证中文为:"+"zhang".matches(中文));
//
// System.out.println("张三验证中文为:"+"张三".matches(英文));
// System.out.println("zhang验证中文为:"+"zhang".matches(英文));
//
// System.out.println("13验证数字为:"+"13".matches(数字));
// System.out.println("aa验证数字为:"+"aa".matches(数字));
//
// System.out.println("13验证整数为:"+"13".matches(整数));
// System.out.println("-13验证整数为:"+"-13".matches(整数));
// System.out.println("+13验证整数为:"+"+13".matches(整数));
// System.out.println("+13验证实数为:"+"+13".matches(实数));
// System.out.println("+13.5验实数字为:"+"+13.5".matches(实数));
// System.out.println("huoleisi@163.com验证邮件为:"+"huoleisi@163.com".matches(邮件));
// System.out.println("huoleisi@163.com.cn验证邮件为:"+"huoleisi@163.com.cn".matches(邮件));
// System.out.println("huoleisi@163.com.jp验证邮件为:"+"huoleisi@163.com.jp".matches(邮件));
// System.out.println("huoleicom验证邮件为:"+"huoleisicom".matches(邮件));
// System.out.println("http://mail.163.com验证网址为:"+"http://mail.163.com".matches(网址));
// System.out.println("http://www.cnjavadown.com/html/lizi-daima/java/javajichu/200809/20-2421.html验证网址为:"+"http://www.cnjavadown.com/html/lizi-daima/java/javajichu/200809/20-2421.html".matches(网址));
// System.out.println("httpa:s/s/mail.16sdf3.com验证网址为:"+"httpa:s/s/mail.16sdf3.com".matches(网址));
// System.out.println("010-85288991验证电话为:"+"010-85288991".matches(电话));
// System.out.println("01011-85288991验证电话为:"+"01011-85288991".matches(电话));
// System.out.println("010-13759944781验证手机为:"+"010-13759944781".matches(手机));
// System.out.println("0.91验证货币为:"+"0.91".matches(货币));
// System.out.println("751300验证邮编为:"+"751300".matches(邮编));
// System.out.println("640324198608110017验证×××为:"+"640324198608110017".matches(×××));
// System.out.println("253287403验证QQ为:"+"253287403".matches(QQ));
}
}