47 $raw = str_replace(
' ',
'', $this->dtd_regex);
51 $el =
'[#a-zA-Z0-9_.-]+';
58 preg_match_all(
"/$el/", $reg, $matches);
59 foreach ($matches[0] as $match) {
60 $this->elements[$match] =
true;
64 $reg = preg_replace(
"/$el/",
'(,\\0)', $reg);
67 $reg = preg_replace(
"/([^,(|]\(+),/",
'\\1', $reg);
70 $reg = preg_replace(
"/,\(/",
'(', $reg);
72 $this->_pcre_regex = $reg;
83 $list_of_children =
'';
85 foreach ($children as $node) {
86 if (!empty($node->is_whitespace)) {
89 $list_of_children .= $node->name .
',';
92 $list_of_children =
',' . rtrim($list_of_children,
',');
95 '/^,?' . $this->_pcre_regex .
'$/',