public static void main(String[] args) {
String str = "123abc中文cde123abc提取123ab";
Pattern p = null;
Matcher m = null;
String value = null;
p = Pattern.compile("([/u4e00-/u9fa5]+)");
m = p.matcher(str);
while (m.find()) {
value = m.group(0);
System.out.println(value);
}
}
运行结果:
中文
提取