regex question - converting text to url
I'm using the following regular expression to convert text strings to <a href> links when displaying a text file on the web.
document.body.innerHTML=document.body.innerHTML.replace(/(http:\/\/)(.*)\s/gi, '<a href=$1$2>$1$2</a><br>'); in the onLoad attribute of the body tag.
I also want to use the same regular expression with the rereplace function on the the text file content so that the text links display as live links in the rss feed I'm creating. I tried to do the following which did not work and I'm not very good with regular expressions.I wondering if someone could point out where I'm going wrong.
<cfset bbcontent = '#REReplace("#bbcontent#", "/(http:\/\/)(.*)\s/gi", "<a href=$1$2>$1$2</a><br>", "ALL")#'>
