Username Validation

Hello,
I am trying to integrate SugarCRM with my app and need to put Form validations on username (Local Login). Can someone please help with the validation rules.
- Is there any minimum & maximum length of username
- What characters are allowed
- Can a username start with numbers or special characters
- Can a username only consist of numbers etc.
Any standard regex will be highly appreciated.
Thanks