In Ruby 1.8, using the URI standard library, I can parse
http://au.easyroommate.com/content/common/listing_detail.aspx?code=H123456789012&from=L123456789012345
using URI.split
to get
["http", nil, "au.easyroommate.com", nil, nil,
"/content/common/listing_detail.aspx", nil,
"code=H123456789012&from=L123456789012345", nil]
But is it possible to get the H123456789012
bit from the query portion without using my own hackery (eg splitting by &
and then getting the bit that matches /code.(.*)/
?