Re: Regular Expressions
| From: | Miguel Cruz | Date: | Thu, 25 Apr 2002 00:17:25 +0000 |
| Subject: | Re: Regular Expressions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-94481@lists.php.net to get a copy of this message | ||
On Wed, 24 Apr 2002, Evan Nemerson wrote:
> A domain cannot contain an underscore, but unless i'm mistaken the
> USERNAME can. the domain name REGEX is [\.a-zA-Z\-]+
>
> ereg("([_a-zA-Z\-]+|\*)\@[\.a-zA-Z\-]+\.[\.a-zA-Z\-]+",$variable);
Right you are. I spaced out right past the @.
But on the other hand usernames can contain all sorts of other characters
too. = and + are popular among people who give out multiple addresses for
mailbox filtering.
miguel