def parse_env(s):
    """Parses the environment portion of string into a dict."""
    m = ENV_RE.search(s)
    if m is None:
        return {}
    g1 = m.group(1)
    env = dict(ENV_SPLIT_RE.findall(g1))
    return env
Parses the environment portion of string into a dict.