RegularExpressionValidator problem

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.
 
P

Paul Shapiro

Check the documentation, but I seem to remember the regex validator has to
use a JavaScript-compatible expression or else disable client-side
validation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top