Re: String Expression for aplpahnumeric password
| From: | @ Edwin | Date: | Fri, 01 Nov 2002 20:45:43 +0000 |
| Subject: | Re: String Expression for aplpahnumeric password | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-122448@lists.php.net to get a copy of this message | ||
Hello,
"Adam" <VBScriptG@btinternet.com> wrote in message
news:20021031222513.80605.qmail@pb1.pair.com...
> I need a string expression to verify an alpha numeric password. This is
what
> i've come up with , however it does not work:
>
> elseif ( (!ereg ("^[a-zA-Z]+$", $password)) || (!ereg ("^[0-9]+$",
> $password)))
>
How about this?
elseif (!eregi("^[[:alnum:]]+$", $password))
HTH,
- E