From: Robert Klemme Date: 2007-09-02T21:00:05+09:00 Subject: Re: Parsing query parameters from hyperlink On 02.09.2007 01:03, lrlebron@gmail.com wrote: > On Sep 1, 3:50 pm, Phil wrote: >> lrleb...@gmail.com wrote: >>> This would work if the string where a proper url. But it is a >>> hyperlink. >> Your point? A hyperlink *is* a URL in the WWW context. >> >> -- >> Phillip Gawlowski > > If you try to parse URI throws an error. Does it? This works for me: irb(main):001:0> require 'uri' => true irb(main):002:0> u=URI.parse('foo.bar/baz?x=2') => # irb(main):003:0> u.query => "x=2" irb(main):004:0> u=URI.parse('baz?x=2') => # irb(main):005:0> u.query => "x=2" Cheers robert