Regular expression Assignment Question

Q: a program to check that a string contain only certain characters (in this case A-Z, a-z,0-9)??