Here you can find the source of isChinaOrEnName(String str)
public static boolean isChinaOrEnName(String str)
//package com.java2s; import com.google.common.base.Strings; public class Main { public static final String ENGLISHNAME = "^[a-zA-Z\\s]+\\.?\\s?[a-zA-Z\\s]+$"; public static final String ALLCHINESE = "^[\u4E00-\u9FA0]+$"; public static boolean isChinaOrEnName(String str) { if (!Strings.isNullOrEmpty(str)) { if (str.matches(ENGLISHNAME)) { return true; }/*w w w . j ava 2 s.co m*/ if (str.matches(ALLCHINESE)) { return true; } } return false; } }