第一种验证方式
Pattern p = Pattern.compile("模式");
 Matcher m = p.matcher("要验证的信息");
 boolean b = m.matches();
 第二种验证方式
 boolean b = Pattern.matches("模式", "要验证的信息");
 第三中验证方式
 boolean b = src.matches("^http://.*")

例如:要验证信息String src是否是http格式,则可以用:boolean b = Pattern.matches("^http://.*",src);

详细:http://www.jb51.net/article/15364.htm