If you are asking how to replace {$game.name.fullname} with the value of $game['name']['fullname'], my first suggestion would be not to allow the template to include any old variable (you don't want access to vars like $secret_password), but make an array of values that can be included.
This tested function has the (commented) regex you want:
If you are asking how to replace {$game.name.fullname} with the value of $game['name']['fullname'], my first suggestion would be not to allow the template to include any old variable (you don't want access to vars like $secret_password), but make an array of values that can be included.
Take a look at this:
Edit: Edited according to ridgerunner's comment. Now matches anything between dots and matches multiple strings.
If you are asking how to convert a string like "{mario.jumper.two}" to a php array like $game['mario']['jumper']='two'