code: def unpack(regex):
      
      if is_packed(regex) and not regex.startswith('(?P<'):
          return re.sub(r'^\((\?:)?(?P<content>.*?)\)$', r'\g<content>', regex)
      else:
          return regex
docs: Remove the outermost parens, keep the (?P...) one
  
      >>> unpack(r'(abc)')
      'abc'
      >>> unpack(r'(?:abc)')
      'abc'
      >>> unpack(r'(?P<xyz>abc)')
      '(?P<xyz>abc)'
      >>> unpack(r'[abc]')
      '[abc]'