Re: regex operators
| From: | Ilia Alshanetsky | Date: | Tue, 14 Oct 2003 18:23:44 +0000 |
| Subject: | Re: regex operators | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-4840@lists.php.net to get a copy of this message | ||
On October 14, 2003 02:14 pm, David Sklar wrote:
> if (! ($_REQUEST['email'] =~ '/^[^@\s]+@([-a-z0-9]+\.)+[a-z]{2,}$/i')) {
> $form->addError('Please enter a valid e-mail address.');
> }
Why not use PERL if you are looking for this sort of functionality? As
indicated by other developers PHP strength comes from ease of use & clarity,
the regex syntax you propose is anything but. Is calling preg_match() that
much of a problem?
Ilia