Regex password

R

Robert Bravery

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
 
E

Ethan Strauss

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
 
J

Jeroen

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
 

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

Similar Threads


Top