Regular Expression Help

  • Thread starter Thread starter Peter Rietmann
  • Start date Start date
P

Peter Rietmann

I have the problem to validate a password with a length of at least 6
and maximum 15 and the condition that it contains at least 2 numbers
ie.
(1aaaa1, aaaa11, 11aaaa). I am using the microsoft Regular Expreession
Validation Control.

I have tried the following at the web site
http://www.regexlib.com/RETester.aspx

^(?=.*?\d.*?\d)([a-zA-Z0-9@*#]{6,15})$

(1aaaa1, aaaa11, 11aaaa). are all valid.

When I use the microsoft Regular Expreession Validation Control.

11aaaa will work but 1aaaa1 will not.

Can anyone help with an expression that will work with the control ?

thanks in advance
 
Expresso is a free regular expression tool, which works well. You can
download it from http://www.codeproject.com/dotnet/Expresso.asp.

However, I think to achieve your objective, you will need to execute two
regular expressions on the password string. One to count the number of
non-numeric characters, and one to count the numeric characters.

Mun
 
Back
Top