Re: Regular Expressions
| From: | Evan Nemerson | Date: | Thu, 25 Apr 2002 00:13:38 +0000 |
| Subject: | Re: Regular Expressions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-94480@lists.php.net to get a copy of this message | ||
A domain cannot contain an underscore, but unless i'm mistaken the USERNAME
can. the domain name REGEX is [\.a-zA-Z\-]+
You're right about the .com. senior moment. here's a better version
ereg("([_a-zA-Z\-]+|\*)\@[\.a-zA-Z\-]+\.[\.a-zA-Z\-]+",$variable);
won't make sure there are letters between the dots, but it will do.
On Wednesday 24 April 2002 17:07 pm, you wrote:
> On Wed, 24 Apr 2002, Evan Nemerson wrote:
> > ereg("([_a-zA-Z\-]+|\*)\@[\.a-zA-Z\-]+\.com",$variable);
> > should work, but test it. I'm not 100% the wildcard part will work.
>
> An internet domain name cannot contain an underscore ( _ ).
>
> ...and a whole lot of them don't end in .com!
>
> miguel
--
Rather fail with honor than succeed by fraud.
Sophocles