java——Matcher

时间:2020-07-16 11:11:52   收藏:0   阅读:64

public static String match(String value ,String complie){
String rs = null;
Pattern regular = Pattern.compile(complie);
Matcher matcher = regular.matcher(value);
if(matcher.find()){
rs = matcher.group(1);
}else{
rs = "没有匹配到想要的东西";
}
return rs;
}

原文:https://www.cnblogs.com/xiaomifeng0510/p/13311312.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!