I have a ruby app parsing a bunch of URLs from strings:
@text = "a string with a url http://example.com"
@text.split.grep(/http[s]?:\/\/\w/)
@text[0] = "http://example.com"
This works fine ^^
But sometimes the URLs have text before the HTTP:// for example
@text = "What's a spacebar? ...http://example.com"
@text[0] = "...http://example.com"
Is there a regex that can select just the text before "http://" in a string so I can strip it out?