I have the following regex to replace everything between [[ and ]] with a callback function. Somehow I don't know how to change it to replace the text between single curly braces { }:
preg_replace_callback('~\[\[((?>[^]]++|](?!]))*)]]~', function ($m) use ($that) {
return "REPLACE TEXT"; }, $layout);