I'm using this regex which so far has been pretty good...
var r = /((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi;
But if I have a string such as the following...
'<div>http://www.a-random-site.com/page1-blah-blah</div>Another bit of text'
Then the bit that is matched would be...
http://www.a-random-site.com/page1-blah-blah</div>Another
How can I alter the regex to take into account that an angled bracked could terminate a link?