I'm trying to write a regex to validate below conditions in a password string
- Atleast one number and a letter
- Should not contain any special characters
Tried this regex
[a-zA-Z]+[0-9]+[a-zA-Z0-9]*|[0-9]+[a-zA-Z][a-zA-Z0-9]*
But it allows special characters. Any help would be appreciated!
Example
- aaaa - Not accepted
- 11111 - Not accepted
- aaaa1 - Accepted
- aaaa1* - Not accepted