Use parenthesis carpturing too for the regex:

```
preg_match_all('#\{(\w+)\}#'...)
$varName = $match[1][0];
```
And for the function maybe something like:
preg_match_all('#\{(?P<variable>\w+).?(?P<function>\w*)\}#'...)
$varName = $match['variable'][0];
$functionName = $match['function'][0];