Regular Expression Help

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
 
M

Munsifali Rashid

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
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top