title: Python : Error of sre_constants.error: unmatched group
body: <p>I know there have been several questions on this subject already, but none help me resolve my problem...</p>
  
  <p>I have to replace names in a csv document when they follow the tags {SPEAKER} or {GROUP OF SPEAKERS}. However, I receive the following error message :</p>
  
  <pre><code>File "/usr/lib/python2.7/re.py", line 291, in filter
      return sre_parse.expand_template(template, match)
    File "/usr/lib/python2.7/sre_parse.py", line 831, in expand_template
      raise error, "unmatched group"
  sre_constants.error: unmatched group
  </code></pre>
  
  <p>The part of my script is :</p>
  
  <pre><code>list_speakers = re.compile(r'^\{GROUP OF SPEAKERS\}\t(.*)|^\{SPEAKER\}\t(.*)')
  
  usernames = set()
  for f in corpus:
      with open(f, "r", encoding=encoding) as fin:
          line = fin.readline()
          while line:
              line = line.rstrip()
              if not line:
                  line = fin.readline()
                  continue
  
              if not list_speakers.match(line):
                  line = fin.readline()
                  continue
  
              names = list_speakers.sub(r'\1', line)
              names = names.split(", ")
              for name in names:
                  usernames.add(name)
  
              line = fin.readline()
  </code></pre>