|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
RegularExpressionValidator problemTrying 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. Check the documentation, but I seem to remember the regex validator has to
use a JavaScript-compatible expression or else disable client-side validation. Show quoteHide quote "Eric L" <Er***@discussions.microsoft.com> wrote in message news:D6DEA7C0-F043-419A-8E21-BABF59D072A6@microsoft.com... > 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.
Dropdownlist datasource dependency
GridView Hyperlink field OnClientClick="javascript:enableValidators(....) error Need help for solution in ASP.NET with VB OnClientClick with confirm doesn't work Panels and dynamic controls...again Validator for checkbox is not getting triggered always Master/Content Page Error in Design/Split View getting and setting data in a Formview |
|||||||||||||||||||||||