#!/usr/local/bin/ruby require 'uri' u = URI.parse("http://example.com/search?q=xxx") p u.request_uri