You are here: Re: Valid email address syntax script? « PHP « IT news, forums, messages
Re: Valid email address syntax script?

Posted by Matthew Weier O'Phinney on 05/03/05 21:18

* Jm <frawst1@gmail.com>:
> Does anyone have a nice email address syntax checking script they'd
> like to share? Regular expression-based anyone? TIA.

I use the following regex:

preg_match('/[^@\s]+@([-a-z0-9]+\.)+[a-z]{2,}$/i', $email)

I believe I got it out of the PHP Cookbook, by David Sklar, but I can't
remember for certain. It's not 100% accurate, but I rarely have
complaints from users whose emails don't validate.

--
Matthew Weier O'Phinney | WEBSITES:
Webmaster and IT Specialist | http://www.garden.org
National Gardening Association | http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org
mailto:matthew@garden.org | http://vermontbotanical.org

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация