If supplying a regex string to the value of an environment variable in the service template, the templating interferes with escaping.
E.g. in the environment vars in the template
{"name": "MY_REGEX_ENV_VAR", "value": "${my_regex}" }
and in the terraform
yields a invalid character '.' in string escape code error from terraform. As far as I can tell there isn't a way to escape the characters in the string to work around this issue.