Your question is a little ambiguous.
If you just want to know whether the string contains letters or numbers (but perhaps only letters or only numbers) and nothing else, then the regex :
pass.matches("^[a-zA-Z0-9]+$");
will return true.
If you want to check whether it contains both letters and numbers, and nothing else, then it is more complex, but something like:
pass.matches("^[a-zA-Z0-9]*(([a-zA-Z][0-9])|([0-9][a-zA-Z]))[a-zA-Z0-9]*$");
all the best