62,614
社区成员
发帖
与我相关
我的任务
分享
public static void main(String[] args) {
String source = "first {test} is here,two {test2} is here!";
String find = "\\u007B.*\\u007D";
Pattern pattern = Pattern.compile(find);
Matcher matcher = pattern.matcher(source);
while(matcher.find()) {
System.out.println(matcher.group());
}
}
String find = "\\u007B.*\\u007D";
String input = "first {test} is here,two {test2} is here!";
Scanner scanner = new Scanner (input);
scanner.findInLine ("first (.+) is here,two (.+) is here!");
MatchResult result = scanner.match();
\\{[^\\}]+\\}
String find = "\\{.*?\\}";
(\\{^\\}+\\})