note 80459 deleted from function.preg-match by felipe

From: Date: Sun, 23 Mar 2008 22:56:54 +0000
Subject: note 80459 deleted from function.preg-match by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-137382@lists.php.net to get a copy of this message
Note Submitter: ghoti ---- 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.

« previous php.notes (#137382) next »