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);
}
}
运行结果:
这个中文
也要提取
转载于:https://blog.51cto.com/jianshusoft/705397