title: Using a regular expression to match a div block having a specific ID
body: <p>I'm trying to match a block of div that have a particular id.. Here's my regex code:</p>
  
  <pre><code>&lt;div\s+[^&gt;]*\s*id\s*=\s*["|']content["|']\s*&gt;[^/div]+
  </code></pre>
  
  <p>I want the regex to match the whole div block. So I put [^/div]+ in my regex, I assume that it will match the remaining characters until it reaches the end of the  but it failed to match until the end because the [^] expression thought that I don't want to match anything that is &lt; / | d | i | v | >. What I want is to consider the whole thing as a whole.Putting a [^()] doens't help either..</p>
  
  <p>So please tell me how should i code this problem</p>
  
  <pre><code>&lt;div id="content"&gt;
      &lt;noscript&gt;&lt;/noscript&gt;
      &lt;a href="blabla.com"&gt;
      &lt;h1&gt;
         &lt;a href="blablac.com"&gt;Blablabla&lt;/a&gt;
      &lt;/h1&gt;
  &lt;/div&gt;
  </code></pre>