title: How to match one&many using regex in php?
body: <h2>I got an irregular codes, I tried DOM but it can't loadHTML or loadXML correctly. Then I have to use regex to match the particular content.</h2>
  
  <p>I want to get c&amp;d's content in <code>a[b=1]</code>. but now i can only get content1.1.</p>
  
  <p>Can anyone tell me why <code>(&lt;d&gt;(.+)&lt;/d&gt;\s+)+</code> cant match all <code>d</code>? I can't find any error about this expression.</p>
  
  <p>Thanks.</p>
  
  <pre><code>&lt;?php
  $a = "
  &lt;a b=1&gt;
      blabla
      &lt;c&gt;content1:&lt;/c&gt;
      &lt;d&gt;content1.1&lt;/d&gt;
      &lt;d&gt;content1.2&lt;/d&gt;
  
      &lt;c&gt;content2:&lt;/c&gt;
      &lt;d&gt;content2.1&lt;/d&gt;
  &lt;/a&gt;
  &lt;a b=2&gt;
      blabla
      &lt;c&gt;content1:&lt;/c&gt;
      &lt;d&gt;content1.1&lt;/d&gt;
  &lt;/a&gt;
  ";
  
  preg_match_all("|&lt;a b=1&gt;.+(&lt;c&gt;(.+):&lt;/c&gt;\s+(&lt;d&gt;(.+)&lt;/d&gt;\s+)+)+.+&lt;/a&gt;|isU", $a, $tmp);
  
  var_dump($tmp);exit;
  </code></pre>