Java 特殊字符正则替换

    @Test
    public void testRegex() throws Exception {
                String str="das:! $%#*(*(";
                String regEx = "[`~!@#$%^&*()+=|{}':;'\[\].<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。,、?]|
|
|	";
                Pattern p = Pattern.compile(regEx);
                Matcher m = p.matcher(str);
                boolean isfind = m.find();
                System.err.println(isfind);
                 //regex 
                String replaceAll = str.replaceAll(regEx, "");
                 System.out.println(replaceAll);
     }
原文地址:https://www.cnblogs.com/lshan/p/13354335.html