Your comments

Allowing evaluation of python code in a snippet could open all kinds of cans of worms...but nested substitutions of a snippet would be a pretty capable feature, something like:

${${var_name/regex/format_string/}/regex/format_string}

If there's a worry about resource usage or recursion, it would be reasonable to set an upper limit on the amount of nesting levels to allow (2 or 3, for example)