def match(path, search)
      matches = get_matches(path)

      if matches.length > 0
        match = matches.sort { |m| m[1] }.first

        @params = match[2]
        add_search_to_params(search)

        match[0]
      else
        nil
      end
    end
def match(path, search)
      matches = get_matches(path)

      if matches.length > 0
        match = matches.sort { |m| m[1] }.first

        @params = match[2]
        add_search_to_params(search)

        match[0]
      else
        nil
      end
    end
Internal method to match a path to the most likely route

 @param [String] path Url to match
 @param [String] search Url search parameters