|
Posted by Rik on 01/27/07 13:31
Geoff Berrow <blthecat@ckdog.co.uk> wrote:
> Does anyone have a good regular expression snippet to validate usernames
> and passwords?
Euhm, validating usernames & passwords with a regex? It all depends on
your requirements offcourse.
The way I usually handle it:
- I'll have a very retrictive character set for the username (usually
something like [a-zA-Z0-9_\s]+).
- Passwords are totally free, you can have a 1MB password string with
chinese characters for all I care. I'll only use the md5'ed version of
this. This means user cannot retrieve passwords, they can only ask for a
link in their email, which would generate a new password for them if they
click on it.
--
Rik Wasmus
Navigation:
[Reply to this message]
|