src/Context.php
public function findAll($re, $filter = null) {
        if ($this->isEmpty()) {
            return self::getEmptyContext();
        }

        if (!preg_match_all($re, $this->toString(), $matches, PREG_SET_ORDER)) {
            $matches = array();
        }

        $result = array();
        foreach ($matches as $match) {
            $context = new self($match);
            if (!$filter || $filter($context)) {
                $result[] = $match;
            }
        }

        return new ContextCollection($result);
    }
public function findAll($re, $filter = null) {
        if ($this->isEmpty()) {
            return self::getEmptyContext();
        }

        if (!preg_match_all($re, $this->toString(), $matches, PREG_SET_ORDER)) {
            $matches = array();
        }

        $result = array();
        foreach ($matches as $match) {
            $context = new self($match);
            if (!$filter || $filter($context)) {
                $result[] = $match;
            }
        }

        return new ContextCollection($result);
    }
public function findAll ( $ re , $ filter = null ) { if ( $ this -> isEmpty ( ) ) { return self :: getEmptyContext ( ) ; } if ( ! preg_match_all ( $ re , $ this -> toString ( ) , $ matches , PREG_SET_ORDER ) ) { $ matches = array ( ) ; } $ result = array ( ) ; foreach ( $ matches as $ match ) { $ context = new self ( $ match ) ; if ( ! $ filter || $ filter ( $ context ) ) { $ result [ ] = $ match ; } } return new ContextCollection ( $ result ) ; }
Find all matching data in the context.
@param  string $re
@param  callbale $filter
@return ContextCollection
Find all matching data in the context .