FilenameFilterIterator
class FilenameFilterIterator extends MultiplePcreFilterIterator
FilenameFilterIterator filters files by patterns (a regexp, a glob, or a string).
Properties
protected | $matchRegexps | from MultiplePcreFilterIterator | |
protected | $noMatchRegexps | from MultiplePcreFilterIterator |
Methods
bool
isAccepted(string $string)
Checks whether the string is accepted by the regex filters.
string
toRegex(string $str)
Converts glob to regexp.
bool
accept()
Filters the iterator values.
Details
protected bool
isAccepted(string $string)
Checks whether the string is accepted by the regex filters.
If there is no regexps defined in the class, this method will accept the string. Such case can be handled by child classes before calling the method if they want to apply a different behavior.