Browse files

Fix handling of UK post codes to be much more specific

We no longer misidentify some one-word names (fern, cru) as post codes
  • Loading branch information...
1 parent f7bae49 commit c623774c5e420a6f0c01077938e5ef46d12d537b @autarch autarch committed Sep 2, 2012
Showing with 11 additions and 2 deletions.
  1. +11 −2 lib/VegGuide/Controller/Site.pm
View
13 lib/VegGuide/Controller/Site.pm
@@ -107,8 +107,17 @@ sub clone_entry_form : Local {
|
(?: # UK
^
- [a-z]{1,2}[0-9r][0-9a-z]?
- (?:\s+[0-9][abd-klmp-uwxyz]{2})?
+ [a-z][0-9]\ [0-9][a-z]{2}
+ |
+ [a-z][0-9]{2}\ [0-9][a-z]{2}
+ |
+ [a-z]{2}[0-9]\ [0-9][a-z]{2}
+ |
+ [a-z]{2}[0-9]{2}\ [0-9][a-z]{2}
+ |
+ [a-z][0-9][a-z]\ [0-9][a-z]{2}
+ |
+ [a-z]{2}[0-9][a-z]\ [0-9][a-z]{2}
$
)
# |

0 comments on commit c623774

Please sign in to comment.