// String pattern = "[\\u4E00-\\u9FA5]+";
String pattern = "[\\u4E00-\\u9FFF]+";
String scope = "120万吨";
//第一种
Pattern p = Pattern.compile(pattern);
if(p.matcher(scope).find()) {
System.out.println("2" + scope);
}else {
System.out.println("3" + scope);
}
//第二种
if(Pattern.matches(pattern, scope)) {
System.out.println("4" + scope);
}else {
System.out.println("5" + scope);
}
这两种方法有什么区别?为什么结果不一样。