Pattern pattern = Pattern.compile("\{(.*?)}");
Matcher matcher = pattern.matcher(string2);
while(matcher.find()){
int i = 1;
System.out.println(matcher.group(i));
i++;
}
正则表达式匹配特殊符号(大括号)中间的字符
最新推荐文章于 2022-08-02 11:27:56 发布
Pattern pattern = Pattern.compile("\{(.*?)}");
Matcher matcher = pattern.matcher(string2);
while(matcher.find()){
int i = 1;
System.out.println(matcher.group(i));
i++;
}