Regex de ponctuation en Java

D'abord, je suis lire la documentation que suivre

http://download.oracle.com/javase/1.4.2/docs/api/java/util/regex/Pattern.html

Et je veux trouver tout caractère de ponctuation à l'EXCEPTION de @',&, mais je ne suis pas tout à fait comprendre.

Est ici :

public static void main( String[] args )
{       
     //String to be scanned to find the pattern.
     String value = "#`~!#$%^";
     String pattern = "\\p{Punct}[^@',&]";

    //Create a Pattern object
    Pattern r = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE);

    //Now create matcher object.
    Matcher m = r.matcher(value);
    if (m.find()) {
       System.out.println("Found value: " + m.groupCount());
    } else {
       System.out.println("NO MATCH");
    }


}

Résultat est PAS à la hauteur.
Est-il incompatibilité ?

Grâce
MRizq

source d'informationauteur MRizq