字符串:0%!~()+_59az@, 0z &6 ***y
RULE:剔除标点符号(除了逗号)
我的代码输出是
false
%!~()+_@&***
我^加在很多地方加了,都不行。。
public class Regular {    /**
     * RULE
     * 1.剔除标点符号
     * 2.
     * @param args
     */
    public static void main(String[] args) {
// TODO Auto-generated method stub
String s="0%!~()+_59az@, 0z &6 ***y";
Pattern p=Pattern.compile("[(\\p{Punct})&&[^,]]");

Matcher m=p.matcher(s);
System.out.println(m.matches());
while(m.find()){
    System.out.print(m.group());
}System.out.println();
    }}