求替换全局img图片的正则表达式
如题
现在有一字符串是
$content = '
test
public static function replace_img_publish_path($content){
$pattern='/()/';
$replacement="\${1}images/pub/\${3}";
print preg_replace($pattern, $replacement, $content);
exit;
}
test
$content = '';
test
$content = preg_replace('#(?echo $content;
pub/1403530150545.jpg" style="width: 268px;">
pub/1403530147265.jpg" style="width: 268px;">test
$content = '';
test
replace_img_publish_path($content);
function replace_img_publish_path($content){
$pattern='/(------解决方案--------------------
IMG].+src=\"?.+)(images\/tmp\/)(.+\.(jpg
------解决方案--------------------
gif
------解决方案--------------------
bmp
------解决方案--------------------
bnp
------解决方案--------------------
png)\"?.+>)/U';
$replacement="\${1}images/pub/\${3}";
print preg_replace($pattern, $replacement, $content);
exit;
}
test
已抢24130个
抢已抢118672个
抢已抢139782个
抢已抢6439个
抢已抢37920个
抢已抢67163个
抢