original_string: protected function dirRegexIteration($dir, $regex)
      {
          $dir   = (string) $dir;
          $regex = (string) $regex;
  
          $dir_iterator      = new \RecursiveDirectoryIterator($dir, \FilesystemIterator::KEY_AS_PATHNAME | \FilesystemIterator::CURRENT_AS_SELF | \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::UNIX_PATHS);
          $iterator_iterator = new \RecursiveIteratorIterator($dir_iterator, \RecursiveIteratorIterator::CHILD_FIRST);
          $regex_iterator    = new \RegexIterator($iterator_iterator, $regex, \RegexIterator::MATCH, \RegexIterator::USE_KEY);
  
          return $regex_iterator;
      }
code: protected function dirRegexIteration($dir, $regex)
      {
          $dir   = (string) $dir;
          $regex = (string) $regex;
  
          $dir_iterator      = new \RecursiveDirectoryIterator($dir, \FilesystemIterator::KEY_AS_PATHNAME | \FilesystemIterator::CURRENT_AS_SELF | \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::UNIX_PATHS);
          $iterator_iterator = new \RecursiveIteratorIterator($dir_iterator, \RecursiveIteratorIterator::CHILD_FIRST);
          $regex_iterator    = new \RegexIterator($iterator_iterator, $regex, \RegexIterator::MATCH, \RegexIterator::USE_KEY);
  
          return $regex_iterator;
      }
code_tokens: protected function dirRegexIteration ( $ dir , $ regex ) { $ dir = ( string ) $ dir ; $ regex = ( string ) $ regex ; $ dir_iterator = new \ RecursiveDirectoryIterator ( $ dir , \ FilesystemIterator :: KEY_AS_PATHNAME | \ FilesystemIterator :: CURRENT_AS_SELF | \ FilesystemIterator :: SKIP_DOTS | \ FilesystemIterator :: UNIX_PATHS ) ; $ iterator_iterator = new \ RecursiveIteratorIterator ( $ dir_iterator , \ RecursiveIteratorIterator :: CHILD_FIRST ) ; $ regex_iterator = new \ RegexIterator ( $ iterator_iterator , $ regex , \ RegexIterator :: MATCH , \ RegexIterator :: USE_KEY ) ; return $ regex_iterator ; }
docstring: Regex directory iterator.
  
  @since 140417 Initial release.
  
  @param string $dir   Path to a directory.
  @param string $regex Regular expression.
  
  @return \RegexIterator
docstring_tokens: Regex directory iterator .