Re: reg expression for ide-emails
| From: | Red Wingate | Date: | Mon, 29 Mar 2004 12:36:09 +0000 |
| Subject: | Re: reg expression for ide-emails | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-181653@lists.php.net to get a copy of this message | ||
Oh yeah,
'Look @ the screen. You will find wonderfull colors there!'
doesn't look like an e-mail adress, does it ? A basic approch to really
check the syntax would be:
preg_match("#^\s*[-\w_]+(\.[-\w_]+)*@[-\w_]+(\.[-\w_]+)+\s*$#sim", $email)
Add your special german or french characters to the first char-bin behind
the @ sign if your servers locale setup won't allow \w to match these.
-- red
Am Montag, 29. März 2004 15:06 schrieb Justin French:
> On Monday, March 29, 2004, at 10:00 PM, John W. Holmes wrote:
> > Robert Kornfeld wrote:
> >> as with april 1, on may use special german and frech characters for
> >> urls and
> >> email-names. does anyone know a reg. expression to validate the
> >> syntax of a
> >> email-adress?
> >
> > if(strpos($email,'@'))
> >
> > No, seriously.
>
> LMFAO -- was just about to say the same thing, but I'd also check for
> at least one period too -- or is that asking too much?
>
> if( strpos($email,'@') && strpos($email,'.') )
>
> ---
> Justin French
> http://indent.com.au