There are several other regex character classes available. There's a section in the grep info
page that documents all of them and what characters they cover.
The real point of the above solution though is not the character class, but the character range construct, which allows you to test for any of a list of individual characters. All a character class is is just a pre-defined range of characters.
As an example, to test for only a subset of punctuation marks, plus spaces and tabs, plus digits, you could use this:
grep -q "[./:;<=>?[:blank:][:digit:]]" testfile && echo found it
The bash [[
extended test can also handle regex, of course. You could use this to test for the existence of punctuation in input arguments, for example:
for arg in "$@"; do
[[ $arg =~ $re ]] && echo "found punctuation in [$arg]"
It's usually best to store the regex pattern in a separate variable first. Otherwise you'll have to worry about escaping shell-reserved characters.
By the way, please use [code][/code]
tags around your code, to preserve formatting and to improve readability.