Thanks mrhappiness.
[a-zA-Z0-9]+ seems reasonable since it requires at least 1 character.
Now what if I desire to have a password of at least 4 letters/numbers and no more than 10 letters/numbers?
Would it be:
[a-zA-Z0-9]{4,10}
Php:
$this->minpasswordlength = 4;
$this->maxpasswordlength = 10;
if (!ereg("[a-zA-Z0-9]{$this->minpasswordlength,$this->maxpasswordlength}", $_POST["txtPassword"])
{
echo "Passwords can only contain letters and numbers and must be a minimum of $this->minpasswordlength characters and maximum of $this->maxpasswordlength characters";
return(FALSE);
}