[PHP] Checking for characters in string

2002-01-04 Thread Richard Black


Hi,

I'm writing a page which will allow user's to register for an online service. They 
register a username and password.

I want the password to contain at least one lowercase letter, at least one upper case 
letter, and at least one digit. So 

passW0rd would be valid, but password would not.

Whats the most compact way to do this? substr? ereg?

Richy

==
Richard Black
Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com
Tel: 0141 435 3504
Email: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Checking for characters in string

2002-01-04 Thread Intruder

 Whats the most compact way to do this? substr? ereg?

I think regular expressions is the best way because working with strings
looks like this:

if ($strtolower($pass)!=$pass)  ($strtoupper($pass)!=$pass) {
  echo OK!;
} else {
  echo WRONG!;
}

but using reg expr it's even more shorter



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]