You can try this function to get yourself started. The search pattern is really basic, but you can add to it, if needed.
I haven't tested this code, so no guarantee that it's bug free.
//returns an array of urls in a string
//returns 0 if no matches found
function &grab_urls($string)
{
preg_match( "/http:\/\/\S+$/i", $string, $matches );
if( isset($matches) ) {
return $matches;
}
return 0;
}