title: How can Python regex ignore case inside a part of a pattern but not the entire expression?
body: <p>Say I have a string containing <code>foobar fooBAR FOObar FOOBAR</code>, and I want to search all instances containing a case insensitive "foo" or "FOO" <em>but</em> a lowercase "bar". In this case, <code>re.findall</code> should return <code>['foobar', 'FOObar']</code>.</p>
  
  <p>The accepted answer for <a href="https://stackoverflow.com/questions/1583678/c-regex-ignore-case-in-pattern">this question</a> explains that it can be done in C# with <code>(?i)foo(?-i)bar</code>, but Python raises an invalid expression error.</p>
  
  <p>Does the Python regex library support such a feature?</p>