How can I check if a string contains only numbers and alphabets ie. is alphanumeric?
Use character classes:
^[[:alnum:]]*$