正则 匹配中英文:[\u4e00-\u9fa5a-zA-Z]
String regEx = "[\\u4e00-\\u9fa5a-zA-Z]";
String str = ":'q,你好CB";
char[] ch = str.toCharArray();
for (char c : ch) {
if (Pattern.matches(regEx, String.valueOf(c))) {
System.out.println("当前char:" + c + ", 匹配," + true);
} else {
System.out.println("当前char:" + c + ", 不匹配," + false);
}
}
System.out.println(str);