note 80459 added to function.preg-match

From: Date: Thu, 17 Jan 2008 08:01:41 +0000
Subject: note 80459 added to function.preg-match
Groups: php.notes 
Request: Send a blank email to php-notes+get-135157@lists.php.net to get a copy of this message
Another pointer regarding the example from BK below.... Email addresses can actually contain a great deal more non-alphanumeric characters than this regexp implies. The characters are listed here in http://www.faqs.org/rfcs/rfc2822.html section 3.2.4. For validating email addresses prior to an actual emailed challenge, I have been using the following regexp with eregi for years to match the left-hand side of an email address: ^[a-z0-9][a-z0-9!#$%&'*+/=?^_`{|}-]+$ Of course, the right-hand side is this: ^([a-z0-9][a-z0-9-]+\.)+[a-z][a-z]+$ Anything more restrictive violates standards. Watch your quotes. ---- Server IP: 216.235.15.211 Probable Submitter: 99.226.95.214 ---- Manual Page -- http://www.php.net/manual/en/function.preg-match.php Edit -- https://master.php.net/note/edit/80459 Del: integrated -- https://master.php.net/note/delete/80459/integrated Del: useless -- https://master.php.net/note/delete/80459/useless Del: bad code -- https://master.php.net/note/delete/80459/bad+code Del: spam -- https://master.php.net/note/delete/80459/spam Del: non-english -- https://master.php.net/note/delete/80459/non-english Del: in docs -- https://master.php.net/note/delete/80459/in+docs Del: other reasons-- https://master.php.net/note/delete/80459 Reject -- https://master.php.net/note/reject/80459 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#135157) next »