title: Why doesn't ignorecase flag (re.I) work in re.sub()
body: <p>From pydoc:</p>
  
  <blockquote>
    <p>re.sub = sub(pattern, repl, string, count=0, flags=0)<br>
        Return the string obtained by replacing the leftmost
        non-overlapping occurrences of the pattern in string by the
        replacement repl.  repl can be either a string or a callable;
        if a string, backslash escapes in it are processed.  If it is
        a callable, it's passed the match object and must return
        a replacement string to be used.</p>
  </blockquote>
  
  <p>example code:</p>
  
  <pre><code>import re
  print re.sub('class', 'function', 'Class object', re.I)
  </code></pre>
  
  <p>No replacement is made unless I change pattern to 'Class'.  </p>
  
  <p>Documentation doesn't mention anything about this limitation, so I assume I may be doing something wrong.  </p>
  
  <p>What's the case here?</p>