title: python re.sub with a list of words to find
body: <p>I am not too familiar with RE but I am trying to iterate over a list and use <code>re.sub</code> to take out multiple items from a large block of text that is held in the variable <code>first_word</code>.</p>
  
  <p>I use <code>re.sub</code> to remove tags first and this works fine, but I next want to remove all the strings in the <code>exclusionList</code> variable and I am not sure how to do this.</p>
  
  <p>Thanks for the help, here is the code that raises the exception.</p>
  
  <pre><code>exclusionList = ['+','of','&lt;ET&gt;f.','to','the','&lt;L&gt;L.&lt;/L&gt;']
  
  for a in range(0, len(exclusionList)):
        first_word = re.sub(exclusionList[a], '',first_word)
  </code></pre>
  
  <p>And the exception :</p>
  
  <pre><code>first_word = re.sub(exclusionList[a], '',first_word)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 151, in sub
  return _compile(pattern, flags).sub(repl, string, count)
      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 245, in _compile
  raise error, v # invalid expression error: nothing to repeat
  </code></pre>