Username Validator

How to validate 'username' it just contain a-z,A-Z,0-9 and no spacing?

Thanks

Thank you Qiang  :D