import java.util.regex.*; public class Gxjun{ public static void main(String args[]) { Pattern p; //模式对象 Matcher m; //匹配对象 String regex = "(http://|www)\56?\\w+\56{1\\w+\56{1}\\p{Alpha}+}"; p =Pattern.compile(regex); String s="新浪:www.sina.c…
Java 后台验证的工具类 public class ValidationUtil { //手机号 public static String mobile = "^((13[0-9])|(14[0-9])|(15[0-9])|(16[0-9])|(17[0-9])|(18[0-9])|(19[0-9]))\\d{8}$"; //不允许为空 public static String blank = ".*[^ ].*"; …