$str = 'http://soft.sina.com/soft/2104_1.html';
preg_match("|http://(.*?)/.*/(\d+).*|i",$str,$m);
echo "域名:$m[1] \n";
echo "数字:$m[2] \n";
preg_match("|http://(.*?)/.*/(\d+).*|i",$str,$m);
echo "域名:$m[1] \n";
echo "数字:$m[2] \n";
$a = 'http://soft.sina.com/soft/2104.html';
$c = 'http://soft.sina.com/soft/2104_1.html';
$b = parse_url($a);
echo $b['host'].'\n';
preg_match('/[0-9]+/',$b['path'],$matches);
echo $matches[0].'\n';
preg_match('/[0-9]{4}/',$c,$matches2);
echo $matches2[0];
?>