From: Thomas Preymesser Date: 2008-02-25T04:30:07+09:00 Subject: Re: Get value from string ------=_Part_8830_26381519.1203881414430 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 24/02/2008, Luca Roma wrote: > > I have a string that content a link of a youtube page . > Like: > http://it.youtube.com/watch?v=PupR5V9aE2s&test=1 irb(main):001:0> require 'uri' => true irb(main):002:0> res = URI.split(' http://it.youtube.com/watch?v=PupR5V9aE2s&test=1') => ["http", nil, "it.youtube.com", nil, nil, "/watch", nil, "v=PupR5V9aE2s&test=1", nil] gives you an array of: * Scheme * Userinfo * Host * Port * Registry * Path * Opaque * Query * Fragment -Thomas ------=_Part_8830_26381519.1203881414430--