$str = "
http://www.baidu/.com?url=www.sina.com/";
preg_match("/http:(.*)com/", $str, $matches);
print_r($matches);
Array ( [0] =>
http://www.baidu/.com?url=www.sina.com [1] => //www.baidu/.com?url=www.sina. )
$str = "
http://www.baidu/.com?url=www.sina.com/";
preg_match("/http:(.*?)com/", $str, $matches);
print_r($matches);