The recursion limit problem still remains even with `g` flag. Clearly, there are not going to be cases where strings will have `{{var}}` added multiple times so much so that adding the `g` flag magically solves everything.