Do you mean like this??
pregmatch("/[a-zA-Z0-9_! ]*$/",$text)
just add all chars you want between the []
care about special chars who have special meanings in regexp: they need to be backslashed - see the manuals
You can also try \w for a-zA-Z0-9...
pregmatch("/[\w_! ]*$/",$text)