title: Python regular expression for Beautiful Soup
body: <p>I am using Beautiful Soup to pull out specific div tags, and it seems I can't use
  simple string matching. </p>
  
  <p>The page has some tags in the form of </p>
  
  <pre><code>&lt;div class="comment form new"...&gt; 
  </code></pre>
  
  <p>which I want to ignore, and also some tags in the form of </p>
  
  <pre><code>&lt;div class="comment comment-xxxx..."&gt; 
  </code></pre>
  
  <p>where the x's represent an integer of arbitrary length, and the ellipses represents an arbitrary number of other values separated by white spaces (that I'm not concerned about). I can't figure out the 
  correct regex expression, especially since I've never used python's re class.</p>
  
  <p>Using</p>
  
  <pre><code>soup.find_all(class_="comment") 
  </code></pre>
  
  <p>finds all tags starting with the word comment. I have tried using</p>
  
  <pre><code>soup.find_all(class_=re.compile(r'(comment)( )(comment)'))
  soup.find_all(class_=re.compile(r'comment comment.*'))
  </code></pre>
  
  <p>and lots of other variations, but I think I'm missing something obvious here about how regex expressions or match() work. Can anyone help me out?</p>