code: def escape_regex_special_chars(api_path):
      
      def substitute(string, replacements):
          pattern, repl = replacements
          return re.sub(pattern, repl, string)
  
      return functools.reduce(substitute, REGEX_REPLACEMENTS, api_path)
docs: Turns the non prametrized path components into strings subtable for using
      as a regex pattern.  This primarily involves escaping special characters so
      that the actual character is matched in the regex.