判断名字是否为中文,是否包含·或者特殊符号等

public static boolean checkCellphone(String cellphone) {
    Pattern p = Pattern.compile("^[\\u4e00-\\u9fa5]+(·[\\u4e00-\\u9fa5]+)*$");
    Matcher m = p.matcher(cellphone);
    return m.matches();
        
}

你可能感兴趣的:(判断名字是否为中文,是否包含·或者特殊符号等)