Strong Password


Vote Up
2
Vote Down

Open in the Regex Tester


Password must be between 6 and 50 characters long and must include at least one upper case letter, one lower case letter, and one number.
Steve Wortham
12/31/2009 8:49:11 PM


3 comments so far.
Log in to leave a comment.

ILee said on 5/17/2010 12:29:30 PM
The sentence "This will not work reliably among Javascript implementations." means that if you use this regular expression in a .NET RegularExpressionValidator you must set the property "EnableClientScript" to false.

A small point but one that will prevent this expression from working in CLR 2.0

Thanks for this site and the expressions on it.

Steve Wortham said on 5/17/2010 2:16:47 PM
You are correct. Of course, I do need to test this to be sure. Positive lookaheads are a Javascript 1.5 feature. In theory it should be usable in modern browsers today if it wasn't for this IE bug:
http://blog.stevenlevithan.com/archives/regex-lookahead-bug

However, I'm not sure if this expression is affected by the bug or not. I'll test it out later today and may revise my disclaimer. ;)

Steve Wortham said on 5/20/2010 1:22:04 AM
So it appears to work fine in IE so I've removed my disclaimer. It's definitely something to look out for with positive lookaheads and JScript, but at least this regular expression works.



<< back to Library