Find and replace URLS in a block of text, return text + list of URLS
<p>I'm trying to find a way to take a block of text, replace all URLs in that text with some other text, then return the new text chunk and a list of URLs it found. Something like:</p>

<pre><code>text = """This is some text www.google.com blah blah http://www.imgur.com/12345.jpg lol"""
text, urls = FindURLs(text, "{{URL}}")
</code></pre>

<p>Should give:</p>

<pre><code>text = "This is some text {{URL}} blah blah {{URL}} lol"
urls = ["www.google.com", "http://www.imgur.com/12345.jpg"]
</code></pre>

<p>I know this will involve some regex - I've found some seemingly good URL detection regex here:
<a href="http://www.regexguru.com/2008/11/detecting-urls-in-a-block-of-text/" rel="nofollow">http://www.regexguru.com/2008/11/detecting-urls-in-a-block-of-text/</a></p>

<p>I'm pretty rubbish with regex, though, so I'm finding that getting it to do what I want with python quite tricky. The order that the URLs are returned in doesn't really matter.</p>

<p>Thanks :)</p>
