Last post Jun 24, 2011 03:03 PM by joejr
Jun 24, 2011 02:06 PM|joejr|LINK
I thought this would be an easy answer to find but 4 hours later...all I'm trying to do is some password validation. It needs to have at least 1 lower case character, 1 uppercase character, 1 number and at least 6 characters in length. I figured I could
do this using "RegularExpressions" however I can't figure out how to determine the "at least one occurance" of each. For example I thought the following would work but it only validates that what is input is a lower case, uppser case or numeric character,
not that the input has at least one of each. The user should be able to enter any characters but at least one of lower case, upper case and numeric characters. Would really appreciate some help on this one. Thanks.
diverrormessage.InnerHtml ="<p>Password must contain at least 1 lower case, 1 upper case and 1 numeric character.</p>"
Jun 24, 2011 02:13 PM|bouwob2|LINK
I do not believe that this is possible. Regex’s are used for pattern matching and you do not have a specific pattern, just several rules.
You will need to make 3 patterns and test each one for your test to see if it is valid or not.
Jun 24, 2011 03:03 PM|joejr|LINK
I just found an almost complete answer to my question:
This in fact checks for at least one occurance of a number, at least one lower and at least one upper case letter. I would like to amend it so that it allows non-alphanumeric
characters also. I don't want it to check for at least one but just allow them. Also a length check of at least 6 characters would be helpful. Thanks again for any suggestions.