R
Rahul
I am using Validator control in Asp.net in my Log On page.
and using a Regularexpression property of the control.
My requirement is to have a password that would have
1) atleast one alphabet
2) atleast one numeric
3) can use [Not Necessary] special characters.
I have tried various combinations of using the regular expressions and
I came up with
^.*(?=.*\d)(?=.*[a-zA-Z]).*$
by using this i am able to acheive the above 3 conditions , But I also
see that i can enter spaces in the password fields, which is not
correct.
I have a set of special characters that can only be entered if at all
they are entered.
for.e.g only allow @#$%^&+=
please note that the combination can occur in any sequence.
for e.g
1) abc123%^
2)123abcdef -- This is correct as 1 alphabet and 1numeric is must.
3)^ghf%678
4)abn^78%7
would really appreciate any help.Please also note that i dont want to
call any Javascript function.I only need to provide a correct regex
expression to the property of the Validator control.
Thanks
Sweety
and using a Regularexpression property of the control.
My requirement is to have a password that would have
1) atleast one alphabet
2) atleast one numeric
3) can use [Not Necessary] special characters.
I have tried various combinations of using the regular expressions and
I came up with
^.*(?=.*\d)(?=.*[a-zA-Z]).*$
by using this i am able to acheive the above 3 conditions , But I also
see that i can enter spaces in the password fields, which is not
correct.
I have a set of special characters that can only be entered if at all
they are entered.
for.e.g only allow @#$%^&+=
please note that the combination can occur in any sequence.
for e.g
1) abc123%^
2)123abcdef -- This is correct as 1 alphabet and 1numeric is must.
3)^ghf%678
4)abn^78%7
would really appreciate any help.Please also note that i dont want to
call any Javascript function.I only need to provide a correct regex
expression to the property of the Validator control.
Thanks
Sweety