实现代码如下:

/**
* 验证 正则表达式
*
* @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正则表达式验证函数】的全部内容了,欢迎留言评论进行交流!

赞(0) 踩(0)
发表我的评论

最新评论

  1. 暂无评论