code: def modify_pattern(self, pattern, group):
          
          pattern = group_regex.sub(r'?P<{}_\1>'.format(self.name), pattern)
          return r'(?P<{}>{})'.format(group, pattern)
docs: Rename groups in regex pattern and enclose it in named group