public static void main(String[] args) {String regx = "(([\u4E00-\u9FA5]{2,7})|([a-zA-Z]{3,10}))"; System.out.println(Pattern.matches(regx, "我我我我我我我")); System.out.println(Pattern.matches(regx, "aBcDefghij"));}