22 '/&(?:[#]x([a-fA-F0-9]+)|[#]0*(\d+)|([A-Za-z_:][A-Za-z0-9.\-_:]*));?/';
59 return preg_replace_callback(
60 $this->_substituteEntitiesRegex,
61 array($this,
'nonSpecialEntityCallback'),
77 $entity = $matches[0];
78 $is_num = (@$matches[0][1] ===
'#');
80 $is_hex = (@$entity[2] ===
'x');
81 $code = $is_hex ? hexdec($matches[1]) : (int) $matches[2];
84 if (isset($this->_special_dec2str[$code]))
return $entity;
88 if (isset($this->_special_ent2dec[$matches[3]]))
return $entity;
89 if (!$this->_entity_lookup) {
92 if (isset($this->_entity_lookup->table[$matches[3]])) {
93 return $this->_entity_lookup->table[$matches[3]];
110 return preg_replace_callback(
111 $this->_substituteEntitiesRegex,
112 array($this,
'specialEntityCallback'),
127 $entity = $matches[0];
128 $is_num = (@$matches[0][1] ===
'#');
130 $is_hex = (@$entity[2] ===
'x');
131 $int = $is_hex ? hexdec($matches[1]) : (int) $matches[2];
132 return isset($this->_special_dec2str[$int]) ?
133 $this->_special_dec2str[$int] :
136 return isset($this->_special_ent2dec[$matches[3]]) ?
137 $this->_special_ent2dec[$matches[3]] :