From: Daniel DeLorme Date: 2007-09-18T08:46:15+09:00 Subject: Re: How do I parse a string to find a URL? 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.com and http://www.xyz.com.") => ["behold:", "http://www.xyz.com."] (notice the period at the end of xyz.com) Daniel