title: PHP Regexp (PCRE) - Find a set of all substrings
body: <p>I have the following string, for example:</p>
  
  <pre><code>aaXXccYYeeXX_ZZkkYYmmXX_ZZnnXXooYYuuXX_ZZvv
  </code></pre>
  
  <p>How can I find all <code>XX.*YY.*ZZ</code> parts in the string? (possibly by using <code>preg_match()</code>)</p>
  
  <ul>
  <li><strong>XX</strong> cc <strong>YY</strong> eeXX_ <strong>ZZ</strong></li>
  <li><strong>XX</strong> _<em>ZZkk <strong>YY</strong> mmXX</em>_ <strong>ZZ</strong></li>
  <li><strong>XX</strong> _<em>ZZnnXXoo <strong>YY</strong> uuXX</em>_ <strong>ZZ</strong></li>
  <li><strong>XX</strong> oo <strong>YY</strong> uuXX_ <strong>ZZ</strong></li>
  </ul>
  
  <p>Plus all longer matches, as:</p>
  
  <ul>
  <li><strong>XX</strong> cc <strong>YY</strong> eeXX_ZZkkYYmmXX_ZZnnXXooYYuuXX_ <strong>ZZ</strong></li>
  </ul>