/**
* 验证 正则表达式
*
* @author zhujie regex 正则表达式 value 所属字符串
* @return boolean
*/
public static boolean regex(String regex, String value) {
Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(value);
return m.find();
}
java正则表达式验证函数
原文:http://www.jb51.net/article/15838.htm