Usando regex para filtrar atributos no xpath com php
Estou tentando filtrar tabelas html com regex que correspondem ao atributo id. O que estou fazendo de errado? Código que estou tentando implementar:
$this->xpath = new DOMXPath($this->dom);
$this->xpath->registerNamespace("php", "http://php.net/xpath");
$this->xpath->registerPHPFunctions();
foreach($xpath->query("//table[php:function('preg_match', '/post\d+/', @id)]") as $key => $row)
{
}
Erro que recebo: preg_match espera que o segundo parâmetro seja uma string, matriz fornecid