title: How to write a regular expression for html parsing?
body: <p>I'm trying to write a regular expression for my html parser.</p>
  
  <p>I want to match a html tag with given attribute (eg. <code>&lt;div&gt;</code> with <code>class="tab news selected"</code> ) that contains one or more <code>&lt;a href&gt;</code> tags. The regexp should match the entire tag (from <code>&lt;div&gt;</code> to <code>&lt;/div&gt;</code>). I always seem to get "memory exhausted" errors - my program probably takes every tag it can find as a matching one.</p>
  
  <p>I'm using boost regex libraries.</p>