digit and char in a string

Sieggy

New member
Joined
Sep 6, 2004
Messages
2
Prob a simple answer but Im pretty new to regex. I need to check a string (password) for the existance of at least one character [a-zA-Z] and also at least one digit. Thanks ahead of time for the help!

Sieggy
 
Sorry I deleted my 1st post. I was thinking you needed to match the whole password, which I dont think is possible in all suituations.

However you only need to check there is at least 1 alpha and 1 numeric character and I assume you are not worried about matching the whole password.

This should work

Code:
(\d+[a-zA-Z]+)|([a-zA-Z]+\d+)
 
Last edited by a moderator:
Back
Top