Maison >développement back-end >tutoriel php >请问各位大神一个正则问题
$str = '[[{"id":"","url":"","title":""xxxxxxxxxxxxxxxxxxxxxxx"","thumb":"","description":"","color":"","size":"14px"}]]';
先需要"title":" 开头 以","thumb" 结尾 替换"xxxxxxxxxxxxxxxxxxxxxxx" 为 \"xxxxxxxxxxxxxxxxxxxxxxx\" 请大神们指导指导
看看是不是你想要的结果
preg_replace("/title\":\"\"(.*)\"\",\"thumb/i","title:\"\\\"\\1\\\"\",\"thumb",$str);