Re: ereg match problem
| From: | ..s.c.o.t.t.. [gts] | Date: | Tue, 20 Feb 2001 20:28:35 +0000 |
| Subject: | Re: ereg match problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-40807@lists.php.net to get a copy of this message | ||
this will work...
(if you wnat to check against any other possible domains,
just add it into the "|" separated list...
(com|edu|cc|uk|org|tv), and so on.
(the following regexp should be all on one line)
preg_match("/([a-zA-Z0-9]+)\@([a-zA-Z0-9]+)\.(com|edu|net|org|tv)/", $email);
----- Original Message -----
From: "richard merit" <richand2002@yahoo.com>
To: <php-general@lists.php.net>
Sent: Tuesday, February 20, 2001 3:06 PM
Subject: Re: [PHP] ereg match problem
> There's a code section at zend.com. I noticed someone
> wrote an email check routine that checks for all
> domains and the correct format. You might try there.
>
> rm
>
> --- "W.D." <suedeuno@yahoo.com> wrote:
> > I'm testing email address, but want to test not only
> > characters but the @
> > sign and for .com, .net, .org, or .tv. How would I
> > include all of these?
> >
> > $test = $email
> > if( ereg("[a-zA-Z0-9]+)\@([a-zA-Z0-9]+)\.com
> > how would I include the
> > rest?
> >