[thelist] regex help - password pattern - javascript

Frank lists at frankmarion.com
Tue Sep 27 09:46:43 CDT 2005


At 08:50 AM 2005-09-27, you wrote:
>Frank, this is only true if you are only allowed alpha and numeric, I'm sure
>the rule was at least 2 alpha (excluding underscores) and at least 2
>numeric, but as for the other 4 characters, they can be anything (percent
>for example), so alpha and numeric won't necessarily always be adjacent.


If any other chars are allowed, then this will return a minimum of two 
alphas and two nums and eight characters

(?=.*[a-z_].*[a-z_])(?=.*[0-9].*[0-9]).{8,}

Test it here
(Search engine wary link. Remove the space in the url. This will be 
out-dated soon enough.)

http://www.frankmarion.com/   test/regex.html



Frank Marion     lists at frankmarion.com      Keep the signal high.





More information about the thelist mailing list