public function QueryPath::filterPreg in QueryPath 6
Same name and namespace in other branches
- 7.3 QueryPath/QueryPath.php \QueryPath::filterPreg()
- 7.2 QueryPath/QueryPath.php \QueryPath::filterPreg()
File
- QueryPath/
QueryPath.php, line 488
Class
Code
public function filterPreg($regex) {
$found = new SplObjectStorage();
foreach ($this->matches as $item) {
if (preg_match($regex, $item->textContent) > 0) {
$found
->attach($item);
}
}
$this
->setMatches($found);
return $this;
}