The title says it:
private static final String onlyAlphaNumericAndPunctuationRegex = "[\\p{Alnum}\\p{Punct}]*";
//returns true
"0123!\"#$%&<=~abcijkxyzABC".matches(onlyAlphaNumericAndPunctuationRegex);
//returns false
"hello test space".matches(onlyAlphaNumericAndPunctuationRegex);
//returns false
"some_àèìòù-ÀÈÌÒÙ_more".matches(onlyAlphaNumericAndPunctuationRegex);
if you need to have at least one character change the regex to:
"[\\p{Alnum}\\p{Punct}]{1,}";