java compile、matcher

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;
}
posted @ 2020-04-13 22:21  采蘑菇的小蜜蜂  阅读(481)  评论(0编辑  收藏  举报