note 43407 added to function.preg-match

From: Date: Sun, 20 Jun 2004 15:52:37 +0000
Subject: note 43407 added to function.preg-match
Groups: php.notes 
Request: Send a blank email to php-notes+get-71401@lists.php.net to get a copy of this message
because email addresses containing dots in the domian name like 'test@domain.dyndns.org' wont work, you need to change the preg_match arguments of webhamster's & zach's post as follows: <?PHP $is_correct_spelled = preg_match("/^[-^!#$%&'*+\/=?`{|}~.\w]+@" . "([-a-zA-Z0-9.]+\.)[-a-zA-Z0-9]{2,6}$/",$email); ?> i also allowed tlds with a length up to 6. this seems to work fine. ---- Manual Page -- http://www.php.net/manual/en/function.preg-match.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+43407 Delete -- http://master.php.net/manage/user-notes.php?action=delete+43407&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+43407&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#71401) next »