public static void main(String[] args) {
String input = "(中文括号)、(英文括号)、(英中文括号)、(中英文括号)";
Pattern pattern = Pattern.compile("[((\\[][\\u4e00-\\u9fa5a-zA-Z0-9]+[))\\]]");
Matcher matcher = pattern.matcher(input);
while (matcher.find()) {
String content = matcher.group();
System.out.println(content.substring(1, content.length() - 1));
}
}
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交