Recently, my colleague Jeroen van Dijk needed to extend (or better yet: override) the
accept()* method for the RegexIterator. Turns out this wasn’t as easy as it might sound in practice. So after extending
and overriding multiple methods he found an acceptable solution. But there is room for improvement. And starting from
PHP 5.4, this improvement is available through regexiterator::getregex()
method.