title: Scan directory for files with specific extensions recursively
body: <p>I am trying to find all files in folder and subfolders with specific extensions.</p>
  
  <pre><code> $dir = new RecursiveDirectoryIterator($directory);
   $iter = new RecursiveIteratorIterator($dir);
   $files = new RegexIterator($iter, '/.*\.(src|in|out|rc)$/i', RecursiveRegexIterator::GET_MATCH);
  </code></pre>
  
  <p>My output should look like this <code>var_dump()</code></p>
  
  <pre><code>  array(105) {
    [2]=&gt;
    string(6) "00.out"
    [3]=&gt;
    string(6) "00.src"
    [4]=&gt;
    string(6) "01.out"...
  }
  </code></pre>
  
  <p>Actual result</p>
  
  <pre><code>object(RegexIterator)#4 (1) {
    ["replacement"]=&gt;
    NULL
  }
  </code></pre>
  
  <p>Where am I doing mistake?
  Thanks for help!</p>