How can I convert {$game.name.fullname} to $game[\'name\'][\'fullname\'] using regex.
thanks
This tested function has the (commented) regex you want:
function process_data(&$text)
{
$re = '/# Reformat a string.
\{ # Opening delimiter.
(\$\w+) # $1: game.
\. # Parts separated by dot.
(\w+) # $2: name.
\. # Parts separated by dot.
(\w+) # $3: fullname.
\} # Closing delimiter.
/ix';
$text = preg_replace($re, "$1['$2']['$3']", $text);
return $text;
}