Say a user submits this comment on a blog:
@SO - Great community, but we've also seen some great communities at Stack Overflow. At the same time Google's Gmail (http://gmail.com) is a great example of a community with endless bounds. I'm just wondering if anyone will really go toe-to-toe with something like http://www.twitter.com. What do you think?
Note: the 3rd url was actually posted as plain text, but SO converted it to a hyperlink.
Anyways, the total url and hyperlink count should be 3.
So, from a Ruby and/or Ruby on Rails perspective: How to count the number of occurences of urls and hyperlinks in a Ruby string?