发布网友 发布时间:2022-04-22 01:26
共1个回答
热心网友 时间:2023-09-23 19:48
参考一下:
public static void main(String[] args) {
String content = "(hello)";
String regex = "(?<=\\().*(?=\\))";
Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(content);
while (m.find()) {
System.out.println(m.group());
}
}