-
Validate the input
Hi,
I have a password textbox on my form. My requirement is that the password should have atleast 2 digits and 1 special character. I tried implementing it with a RegularExpressionValidator with the validation expression defined as
[a-zA-Z]*[!@#$%^&*_+|\=-]{1,}[\d]{2,}
The problem with this expression is that this requires the input to have the same order of characters while i would like the characters to be allowed in any order. As long as there are 2 digits and 1 spl character it should accept.
Thanx in advance
-
Re: Validate the input
Well a simple solution would be to have 2 counters one for digits and another for special characters.... Just browse the string and increase the counters acordingly.
Regards
Jorge
-
Re: Validate the input
Thanx Jorge,
but i m looking for a regular expression because my requirement with the password may change & changing the code at a later time might not be advisable.
m still on the lookout for a reg exp. any help?
-
Re: Validate the input
Hi,
I'm really poor at RegEx, but perhaps this could help.
Cheers,
NTG
-
Re: Validate the input
I don't know if this helps, but check (anotherVBnewbie post) this out.
http://www.vbforums.com/showthread.p...=1#post2022318
-
Re: Validate the input
I don't know if this helps, but check (anotherVBnewbie post) this out.
http://www.vbforums.com/showthread.p...=1#post2022318