note 63099 added to function.ereg
| From: | TristanScott-trs998 at gmail dot com | Date: | Mon, 13 Mar 2006 16:15:32 +0000 |
| Subject: | note 63099 added to function.ereg | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-105716@lists.php.net to get a copy of this message | ||
ereg("^[a-zA-Z]{1,2}((\d{1,2})|(\d{1}[a-zA-Z]{1}))[ ]?\d{1}[a-zA-Z]{2}$")
Should check for valid postcodes in the uk.
Note: this will not match GIR 0AA, whcih is in use but doesn't follow the post office rules.
also, this is not strict... some invalid postcodes are permitted some letters do not appear in some
positions. It will, however, match:
AN NAA
ANN NAA
AAN NAA
AANN NAA
ANA NAA
AANA NAA
----
Server IP: 84.18.202.180
Probable Submitter: 84.45.223.183
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.ereg.php
Edit -- http://master.php.net/note/edit/63099
Del: integrated -- http://master.php.net/note/delete/63099/integrated
Del: useless -- http://master.php.net/note/delete/63099/useless
Del: bad code -- http://master.php.net/note/delete/63099/bad+code
Del: spam -- http://master.php.net/note/delete/63099/spam
Del: non-english -- http://master.php.net/note/delete/63099/non-english
Del: in docs -- http://master.php.net/note/delete/63099/in+docs
Del: other reasons-- http://master.php.net/note/delete/63099
Reject -- http://master.php.net/note/reject/63099
Search -- http://master.php.net/manage/user-notes.php