$player = '<object foo="bar&soundFile=\\1"/>'; $texto = preg_replace('/\[audio\](.+?)\[\/audio\]/i', $player, $texto);