|
-
Dec 28th, 2004, 04:29 AM
#1
Thread Starter
Addicted Member
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
-
Dec 28th, 2004, 05:21 AM
#2
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
"The dark side clouds everything. Impossible to see the future is."
-
Dec 29th, 2004, 03:25 AM
#3
Thread Starter
Addicted Member
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?
-
Dec 29th, 2004, 04:11 AM
#4
Re: Validate the input
Hi,
I'm really poor at RegEx, but perhaps this could help.
Cheers,
NTG
-
May 23rd, 2005, 01:33 AM
#5
Member
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
Yoroshiku,
 seraphicmortal
______________________________________________________
Thirst for knowledge can never be quenched...Ask for more!!.
Oh! Please..Show your appreciation by clicking  if you deem this post helpful.
Rate this Post! 
-
May 23rd, 2005, 01:35 AM
#6
Member
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
Yoroshiku,
 seraphicmortal
______________________________________________________
Thirst for knowledge can never be quenched...Ask for more!!.
Oh! Please..Show your appreciation by clicking  if you deem this post helpful.
Rate this Post! 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|