public static boolean isNumbersWithPunctuation(String token){
  boolean hasDigit=false;
  int len=token.length();
  for (int i=0; i < len; ++i) {
    char c=token.charAt(i);
    hasDigit=hasDigit || Character.isDigit(c);
    if (!(Character.isDigit(c) || Characters.isPunctuation(c))) {
      return false;
    }
  }
  return hasDigit;
}

public static boolean isNumbersWithPunctuation ( String token ) { boolean hasDigit = false ; int len = token . length ( ) ; for ( int i = 0 ; i < len ; ++ i ) { char c = token . charAt ( i ) ; hasDigit = hasDigit || Character . isDigit ( c ) ; if ( ! ( Character . isDigit ( c ) || Characters . isPunctuation ( c ) ) ) { return false ; } } return hasDigit ; }
true if the input string contains at least one digit and 0 or more punctuation characters . false otherwise .
