_frontend/profile: Use non-greedy search to substitute variables
Use non-greedy search to ensure that we stop at the next closing brace.
Otherwise, for a string like %{variable} {variable}
, the second
variable will also get substituted.
Fixes #1307 (closed).