Re: Quickform rules & documentation
| From: | Bertrand Mansion | Date: | Wed, 21 May 2003 16:47:27 +0000 |
| Subject: | Re: Quickform rules & documentation | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-5514@lists.php.net to get a copy of this message | ||
<mcarter@quantiv.com> wrote :
> Did I see somewhere that you can specify regular expressions to validate
> form field content? I can't find any examples of it in use now!
>
> I wanted to check if a URL was vaid using:
> ^(http|https|ftp)\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(:[a-zA-Z0-9]*)?/?([a-zA
> -Z0-9\-\._\?\,\'/\\\+&%\$#\=~])*$
$form->addRule('urlfield', 'URL not good, baby', 'regex',
'/^(http|https|ftp)\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(:[a-zA-Z0-9]*)?/?([a-
zA-Z0-9\-\._\?\,\'/\\\+&%\$#\=~])*$/');
Bertrand Mansion
Mamasam