note 103736 added to function.preg-match

From: Date: Sat, 30 Apr 2011 09:36:07 +0000
Subject: note 103736 added to function.preg-match
Groups: php.notes 
Request: Send a blank email to php-notes+get-179302@lists.php.net to get a copy of this message
Validate an E-Mail Address (Format) modified your email validation pattern to solve these issues: <?php $pattern = "/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/"; $email = "mymail@mysite.com"; if (!preg_match($pattern, $email)) { echo "ERROR! your mail is not valid."; } else { echo "SUCCESS. your mail is valid."; } ?> ---- Server IP: 69.147.83.197 Probable Submitter: 109.109.47.43 ---- Manual Page -- http://www.php.net/manual/en/function.preg-match.php Edit -- https://master.php.net/note/edit/103736 Del: integrated -- https://master.php.net/note/delete/103736/integrated Del: useless -- https://master.php.net/note/delete/103736/useless Del: bad code -- https://master.php.net/note/delete/103736/bad+code Del: spam -- https://master.php.net/note/delete/103736/spam Del: non-english -- https://master.php.net/note/delete/103736/non-english Del: in docs -- https://master.php.net/note/delete/103736/in+docs Del: other reasons-- https://master.php.net/note/delete/103736 Reject -- https://master.php.net/note/reject/103736 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#179302) next »