Checks if username contains valid characters.