E
Eric L
Trying to use a regex validator control to check password complexity
requirements in an ASP.NET 1.1 web app. Here is the regex:
(?=(.*?[a-z].*?){2,})(?=(.*?[A-Z].*?){2,})(?=(.*?\d.*?){2,})(?=(.*?[!#\$%\^&\*@_\|\-=`~\[\]\{\},<>].*?){2,})^.{14,32}$
The expression uses lookaheads to check for two lowercase, two uppercase,
two numeric, and two listed special character, and to verify that the length
of the entire string is between 14 and 32 characters.
Using the System.Text.RegularExpressions.Regex.IsMatch method reports
correctly based on the input string, but the ASP.NET validator control always
reports that any input does not match the regex. Anyone have an idea why?
Any workarounds to get client side validation to work using the validator
control? Upgrading is out as this is a legacy .NET 1.1 I'm supporting.
requirements in an ASP.NET 1.1 web app. Here is the regex:
(?=(.*?[a-z].*?){2,})(?=(.*?[A-Z].*?){2,})(?=(.*?\d.*?){2,})(?=(.*?[!#\$%\^&\*@_\|\-=`~\[\]\{\},<>].*?){2,})^.{14,32}$
The expression uses lookaheads to check for two lowercase, two uppercase,
two numeric, and two listed special character, and to verify that the length
of the entire string is between 14 and 32 characters.
Using the System.Text.RegularExpressions.Regex.IsMatch method reports
correctly based on the input string, but the ASP.NET validator control always
reports that any input does not match the regex. Anyone have an idea why?
Any workarounds to get client side validation to work using the validator
control? Upgrading is out as this is a legacy .NET 1.1 I'm supporting.