验证只能输入中文

public static boolean checkIsChinese(String input) {
Matcher m1 = Pattern.compile("^[\u4E00-\uFA29]*$").matcher(input);
Matcher m2 = Pattern.compile("^[\uE7C7-\uE7F3]*$").matcher(input);
if(!m1.find() && !m2.find()) {
return false;
}else{
return true;
}
}

原文地址:https://www.cnblogs.com/bella-life-blog/p/3759415.html