Re: form validation question - regex not working
| From: | Jason Wong | Date: | Wed, 21 Aug 2002 19:10:02 +0000 |
| Subject: | Re: form validation question - regex not working | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-21297@lists.php.net to get a copy of this message | ||
On Thursday 22 August 2002 02:54, chip.wiegand@simrad.com wrote:
> This is from a php/mysql book.
If they're presenting it as something that you can use in your real-life code
then you should look carefully at all the other code in the book to see
whether they're all as sloppy. On the other hand if they're only presenting
it as an example on using regex then it's fine for learning with.
> I added the parenthesis simply to group the
> sections, and added the {2,3} because a web site tutorial shows that will
> limit the preceding section to that many characters (2 or 3 only in this
> case).
> The script works fine without the {2,3}, and I may have to use it that way,
> since another response mentioned foreign addresses, I hadn't taken into
> account.
> I'd just like to know why it doesn't work, becuase the it's supposed to.
It's only checking for addresses of the form aaa@bbb.ccc
As you can see, the list address (php-db@lists.php.net), and my address
(phplist@gremlins.com.hk) would be treated as invalid. Not very clever is it?
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
/*
"His great aim was to escape from civilization, and, as soon as he had
money, he went to Southern California."
*/