// 过滤特殊字符 public staticString StringFilter(String str) throws PatternSyntaxException {
// 只允许字母和数字 // String regEx =”[^a-zA-Z0-9]”;
// 清除掉所有特殊字符


/**
     * 过滤特殊字符
     * @param str
     * @return
     */
    public static String stringFilter (String str){
        String regEx="[`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。,、?]";
        Pattern p = Pattern.compile(regEx);
        Matcher m = p.matcher(str);
        return m.replaceAll("").trim();
    }