note 18764 deleted from function.ereg by sander
| From: | sander@php.net | Date: | Sun, 12 May 2002 15:53:09 +0000 |
| Subject: | note 18764 deleted from function.ereg by sander | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-30540@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!";
}