Re: eregi() problem
| From: | Miguel Cruz | Date: | Mon, 22 Apr 2002 07:05:28 +0000 |
| Subject: | Re: eregi() problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-93943@lists.php.net to get a copy of this message | ||
On Mon, 22 Apr 2002, Gregor Jaksa wrote:
> if (!eregi("^[[:alpha:]]$", $HTTP_POST_VARS["vpis_ime"]))
> echo "wrong char";
>
> why does this always return "wrong char" no matter what value is in vpis_ime
> ... i tried "blah", "242234" "bla242h" .. every single time i get
> "wrong
> char". im using PHP 4.1.2
The only thing that will match that regex is a single alpha character.
Try "^[[:alpha:]]+$" (I added a plus) to match one or more.
miguel