[php-src] Issue #7730: RecursiveRegexIterator
| From: | noreply@php.net | Date: | Tue, 07 Dec 2021 11:32:04 +0000 |
| Subject: | [php-src] Issue #7730: RecursiveRegexIterator | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-238243@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/7730
Comment Author: cmb69
If you don't want to recurse into subdirecties, there is no need for Recursive*Iterators. Try:
````.php
$iterator = new RegexIterator(
new FilesystemIterator( __DIR__, FilesystemIterator ::UNIX_PATHS),
'/((?:[A-Z][a-zA-Z\d]+\/)*[A-Z][a-zA-Z\d]+)\.php$/',
RegexIterator::GET_MATCH,
RegexIterator::USE_KEY
);
````