Hi all,
Trying to validate a password with a regularexpressionvalidator
But cant get the regex to work correctly
I' look for a Alpha-numeric password of at least 7 in length and no upper
limit in length
Thanks
Robert
Ethan Strauss - 18 Mar 2008 15:19 GMT
I belive that
Regex Passwords = new Regex("\w{7,}");
will do it.
That is:
Any word character (all letters, all numerals)
At least 7 of them.
No upper limit.
Ethan
> Hi all,
>
[quoted text clipped - 5 lines]
> Thanks
> Robert
Jeroen - 18 Mar 2008 15:23 GMT
Haven't tested, but this might start you off :-)
string alphaNum = "[a-zA-Z0-9_]";
string pattern = "";
pattern += alphaNum + alphaNum + alphaNum + alphaNum;
pattern += alphaNum + alphaNum + alphaNum;
pattern += alphaNum + "*";
pattern += "$";
Regards,
Jeroen