extract url from string with Javascript
<p>this sounds like something you could just google, but been looking for hours.</p>

<p>basically have this string i am ajaxing from another site</p>

<pre><code>'function onclick(event) { toFacebook("http://www.domain.com.au/deal/url-test?2049361208?226781981"); }'
</code></pre>

<p>it comes out like that because im extracting the onclick.</p>

<p>i just want to extract the url from the string.</p>

<p>any help would be greatly appreciated.</p>

<p>---- edit ----</p>

<p>OK IF I GO HERE..http://regexlib.com/RESilverlight.aspx regext online tester</p>

<p>and run this regex. </p>

<pre><code>(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&amp;amp;:/~\+#]*[\w\-\@?^=%&amp;amp;/~\+#])?
</code></pre>

<p>on my string, it highlights the url perfectly.. i just can get it to run with JS?</p>
