public function find($regexpPattern = '.*', $sort = false)
    {
        list(, $files) = $this->read($sort);

        return array_values(preg_grep('/^' . $regexpPattern . '$/i', $files));
    }
public function find($regexpPattern = '.*', $sort = false)
    {
        list(, $files) = $this->read($sort);

        return array_values(preg_grep('/^' . $regexpPattern . '$/i', $files));
    }
public function find ( $ regexpPattern = '.*' , $ sort = false ) { list ( , $ files ) = $ this -> read ( $ sort ) ; return array_values ( preg_grep ( '/^' . $ regexpPattern . '$/i' , $ files ) ) ; }
Returns an array of all matching files in current directory.

@param string $regexpPattern Preg_match pattern (Defaults to: .*)
@param bool $sort Whether results should be sorted.
@return array Files that match given pattern
Returns an array of all matching files in current directory .