<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def regex_parse_template(self, template, pattern):
 """ Parse template for the regex module. Do NOT edit the literal list returned by _compile_replacement_helper as you will edit the original cached value. Copy the values instead. """


        groups = []
        literals = []
        replacements = _compile_replacement_helper(pattern, template)
        count = 0
        for part in replacements:
            if isinstance(part, int):
                literals.append(None)
                groups.append((count, part))
            else:
                literals.append(part)
            count += 1
        return groups, literals