note 18764 added to function.ereg

From: Date: Mon, 04 Feb 2002 18:05:56 +0000
Subject: note 18764 added to function.ereg
Groups: php.notes 
Request: Send a blank email to php-notes+get-26243@lists.php.net to get a copy of this message
And as typical, after writing that correction I found my correction isn't correct either! UK Postcodes can have a zero as a number digit, so the [1-9] in the above should be changed to [0-9]. For completeness the correct code is: if(eregi('^[A-Z]{1,2}[0-9]{1,2}[A-Z]? ?[0-9][A-Z]{2}$',$postcode)) { print "A correct postcode!"; } -- http://www.php.net/manual/en/function.ereg.php http://master.php.net/manage/user-notes.php?action=edit+18764 http://master.php.net/manage/user-notes.php?action=delete+18764 http://master.php.net/manage/user-notes.php?action=reject+18764

« previous php.notes (#26243) next »