标签:replace print match void 特殊字符 style acea mat row
@Test public void testRegex() throws Exception { String str="das:! $%#*(*("; String regEx = "[`~!@#$%^&*()+=|{}‘:;‘\\[\\].<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。,、?]|\n|\r|\t"; 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); }
标签:replace print match void 特殊字符 style acea mat row
原文地址:https://www.cnblogs.com/lshan/p/13354335.html