RegularExpressionValidator Issues

  • Thread starter Thread starter John Yopp
  • Start date Start date
J

John Yopp

I'm trying to use a asp:RegularExpressionValidator to validate the
strength of a password. When I test the regular expression with
Regex.IsMatch, it works perfectly. However, when used within a
RegularExpressionValidator, it always returns false.

Has anyone else had issues with the RegularExpressionValidator not
correctly parsing a regular expression?

The regular expression I am using is:
"^.*(?=.*\d)|(?=.*[^a-zA-Z0-9])|(?=.*[A-Z])(?=.*[a-z])(?=.{8,}).*$"

Thanks
 
John,

I'm not 100% positive about this, but if I'm thinking clearly try removing
the caret "^" at the beginning of your regular expression and the dollar
sign "$" at the end. I believe they are needed when using Regex.IsMatch, but
I believe that the RegularExpressionValidator adds them for you.

Let us know if that was it...

Regards,

--
S. Justin Gengo
Web Developer / Programmer

Free code library:
http://www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
Back
Top