QueryPath\DOMQuery::filterPreg PHP Метод

filterPreg() публичный Метод

Only items that match the given regular expression will be kept. All others will be removed. The regular expression is run against the text content (the PCDATA) of the elements. This is a way of filtering elements based on their content. Example:
См. также: filter()
См. также: filterCallback()
См. также: preg_match()
public filterPreg ( string $regex )
$regex string A regular expression.
    public function filterPreg($regex)
    {
        $found = new \SplObjectStorage();
        foreach ($this->matches as $item) {
            if (preg_match($regex, $item->textContent) > 0) {
                $found->attach($item);
            }
        }
        return $this->inst($found, null, $this->options);
    }