title: Matching tags in BeautifulSoup
body: <p>I'm trying to count the number of tags in the 'soup' from a beautifulsoup result. I'd like to use a regular expression but am having trouble.
  The code Ive tried is as follows:</p>
  
  <pre><code>reg_exp_tag = re.compile("&lt;[^&gt;*&gt;")
  tags = re.findall(reg_exp_tag, soup(cast as a string))
  </code></pre>
  
  <p>but <code>re</code> will not allow <code>reg_exp_tag</code>, giving an unexpected end of regular expression error.</p>
  
  <p>Any help would be much appreciated!</p>
  
  <p>Thanks</p>