想要从一段html中提取出这样的地址:http://storage.live.com/items/9A8B8BF501A38A36!1211?filename=%e7%82%b9%e5%87%bb%e7%ac%ac%e5%87%a0%e9%a1%b5.jpg
然后对应的php代码为:# current support valid pic suffiex: 'bmp', 'gif', 'jpeg', 'jpg', 'jpe', 'png', 'tiff', 'tif'
$picSufChars = "befgijmnptBEFGIJMNPT";
if(preg_match($pattern, $content, $matches)){
$picUrl = $matches["picUrl"];
//print "found picUrl=".$picUrl;
if(preg_match('#http://storage\.live\.com/items/.+?filename=(?P.+)#', $picUrl, $foundFilename)){
$filename = $foundFilename["filename"];
$filename = rawurldecode($filename);
}
else{
$filename = "";
}
} else {
$picUrl = "";
}