Hi,

The following regexp is supposed to chop off the last / of a string
and all characters following it, but it seems to be ignoring the
non-greedy indicator (?):

irb(main):001:0> "http://www.x.com/y/z.html".sub(%r|/.+?\.html$|, '')
"http:"

The expected result should be "http://www.x.com/y".  I thought this
was a bug but perl produces the same result, so what am I missing?

Is there a better alternative to doing url parsing by hand?

Thanks

-- 
tom / alkali.spamfree.org
remove 'spamfree.' to respond