<p>In app/controllers/geocoder_controller.rb:</p>
<pre style='color:#555'>> @@ -312,4 +314,26 @@ def count_results(results)
>    def escape_query(query)
>      return URI.escape(query, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]", false, 'N'))
>    end
> +
> +  def convert_latlon
> +    @query = params[:query]
> +
> +    if latlon = @query.match(/^([NS])\s*(\d{1,3}\.?\d*)\W*([EW])\s*(\d{1,3}\.?\d*)$/).try(:captures) # [NSEW] decimal degrees
> +      params[:query] = view_context.nsew_to_decdeg(latlon)
> +    elsif latlon = @query.match(/^(\d{1,3}\.?\d*)\s*([NS])\W*(\d{1,3}\.?\d*)\s*([EW])$/).try(:captures) # degrees, decimal minutes [NSEW]
</pre>
<p>I don't think <code>\.?\d*</code> is right here (or on any of the others) as we shouldn't be matching the digits unless we saw the decimal point first, so surely the two should be grouped with the <code>?</code> covering both?</p>

<p>In addition the comment on this line is wrong - looks like it has been cut and pasted.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href='https://github.com/openstreetmap/openstreetmap-website/pull/216/files#r3197375'>view it on GitHub</a>.<img src='https://github.com/notifications/beacon/uTRSc6ihLa7Shf84BpiOpswm2upcLXkvSUV9Ff7I2X2AMGIam68vFFgovLsKBb-e.gif' height='1' width='1'></p>