title: Extract the text from <b></b> tags
body: <p>I have the text (code for Python 2.6):</p>
  
  <pre><code>txt="foo&lt;br&gt;&lt;br&gt;&lt;b&gt;bar :&lt;/b&gt;&lt;br&gt;foo&lt;br&gt;&lt;b&gt;bar :&lt;/b&gt;"
  </code></pre>
  
  <p>Then I tried to extract the contents of any tag (&lt;b> tag in this example):</p>
  
  <pre><code>r=re.compile("&lt;%s.*?&gt;(.+?)&lt;/%s&gt;" % ("b","b"), re.I|re.S)
  </code></pre>
  
  <p>This mostly works, but the output is not what I've expected for my tricky text:</p>
  
  <pre><code>&gt;&gt;&gt;re.findall(r,txt)
  ['&lt;br&gt;&lt;b&gt;bar :', 'foo&lt;br&gt;&lt;b&gt;bar :']
  </code></pre>
  
  <p>Is it possible to write one regular expression to extract the text from any HTML tag in any case?</p>