以下代码给了我一个错误“preg_replace() [function.preg-replace]: Unknown modifier '?'”
$str = 'background: url("../../dsdgsd/contain.jpg");';
echo preg_replace('/url\s?\(\s?(\"|\')([../?]*[a-z/]*?[/?]?)([a-z0-9_-]*[.][jpg|jpeg|png|jpeg]*)([\'|\"]\))/gi','url("../images/$3")',$str);