From 1be46302e47eb517525d2afb52ffc5d3a9cbf917 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 7 Aug 2007 23:20:25 +0000 Subject: [PATCH 1/1] Recognise UK postcodes with a space in the middle. --- app/controllers/geocoder_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/geocoder_controller.rb b/app/controllers/geocoder_controller.rb index 480dc5419..34a90935e 100644 --- a/app/controllers/geocoder_controller.rb +++ b/app/controllers/geocoder_controller.rb @@ -9,7 +9,7 @@ class GeocoderController < ApplicationController if @query.match(/^\d{5}(-\d{4})?$/) @results.push search_us_postcode(@query) - elsif @query.match(/(GIR 0AA|[A-PR-UWYZ]([0-9]{1,2}|([A-HK-Y][0-9]|[A-HK-Y][0-9]([0-9]|[ABEHMNPRV-Y]))|[0-9][A-HJKS-UW]) [0-9][ABD-HJLNP-UW-Z]{2})/i) + elsif @query.match(/(GIR 0AA|[A-PR-UWYZ]([0-9]{1,2}|([A-HK-Y][0-9]|[A-HK-Y][0-9]([0-9]|[ABEHMNPRV-Y]))|[0-9][A-HJKS-UW])\s*[0-9][ABD-HJLNP-UW-Z]{2})/i) @results.push search_uk_postcode(@query) elsif @query.match(/[A-Z]\d[A-Z]\s*\d[A-Z]\d/i) @results.push search_ca_postcode(@query) -- 2.43.2