Re: Valid email address syntax script?

From: Date: Tue, 03 May 2005 18:18:27 +0000
Subject: Re: Valid email address syntax script?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-214380@lists.php.net to get a copy of this message
* 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

« previous php.general (#214380) next »