This is pretty simple, as you have stated it:
"^[^\,\;\s]{1,15}$"
or, if using C#:
"^[^\\,\\;\\s]{1,15}$"
I also disallowed spaces (besides comma and semicolon).
But are you SURE this is what you want? It means that all of the following passwords are *LEGAL*:
a
?
©
©©©©©
?©
1
©©©©©©©©©©©©©©©©©©
Is that REALLY what you want????
Most companies are much more restrictive. MS rules, for example:
Minimum of 6 characters, maximum of 18 [not sure about that max]
Must contain at least one upper case letter
Must contain at least one lower case letter
Must contain at least one digit
Must contain at least one non-alphanumeric character [I think chosen from a list, but not sure]
Now *THAT* is a much more reasonable "strong password". And it's also a much much tougher regular expression, though I believe it *is* doable.
[By the way: Why are comma and semicolon, of all things, disallowed??? I would see apostrophes and maybe quotes, but those characters? Why?]
|