From: franco Date: 2007-09-18T10:35:11+09:00 Subject: Re: How do I parse a string to find a URL? On Sep 17, 7:46 pm, Daniel DeLorme wrote: > Jano Svitok wrote: > > On 9/17/07, Jayson Williams wrote: > >> Is there a command in Ruby that will accept a string, and spit out a > >> URL that is contained in the string? I think I remember reading about > >> something that would do this, but I cant recall. > > > URI::extract > > >http://ruby-doc.org/core/classes/URI.html#M004839 > > Wow, I didn't know about that, very nice. But it has a few weaknesses: > >> URI.extract("behold:www.abc.comandhttp://www.xyz.com.") > => ["behold:", "http://www.xyz.com."] > (notice the period at the end of xyz.com) > > Daniel also the period is legal,