code: def get_environment_var(varstr):
      
      mo=_get_env_var.match(to_String(varstr))
      if mo:
          var = mo.group(1)
          if var[0] == '{':
              return var[1:-1]
          else:
              return var
      else:
          return None
docs: Given a string, first determine if it looks like a reference
      to a single environment variable, like "$FOO" or "${FOO}".
      If so, return that variable with no decorations ("FOO").
      If not, return None.