From: Tom Hughes Date: Tue, 7 Aug 2007 23:20:25 +0000 (+0000) Subject: Recognise UK postcodes with a space in the middle. X-Git-Tag: live~8254 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/1be46302e47eb517525d2afb52ffc5d3a9cbf917?hp=2408dd333f43c98c23c5539e90b327055a06659a Recognise UK postcodes with a space in the middle. --- 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)