提取URL

$url = '风格风格上的风格http://www.baidu.com/index.php/v.jpg啊手动阀http://www.baidu.com/v.swf手动阀';

var_dump(preg_match_all('/((http|https):(\/\/|\\\\)((\w)+[.]){1,}([a-z]{1,3}|[0-9]{1,3})(((\/[\~]*|\\[\~]*)(\w)+)|[.](\w)+)*(((([?](\w)+){1}[=]*))*((\w)+){1}([\&](\w)+[\=]((\w)+|-|%|\+|\#|(\w)+)*)*))/',$url,$match));
//var_dump($match);

echo preg_replace_callback('/((http|https):(\/\/|\\\\)((\w)+[.]){1,}([a-z]{1,3}|[0-9]{1,3})(((\/[\~]*|\\[\~]*)(\w)+)|[.](\w)+)*(((([?](\w)+){1}[=]*))*((\w)+){1}([\&](\w)+[\=]((\w)+|-|%|\+|\#|(\w)+)*)*))/',function($matchs){
return '<a href="'.$matchs[0].'" target="_blank">'.$matchs[0].'</a>';
},$url);