I'd recommend making the "plus" lazy... ie: '/<\?.+?\?>/'
That way it will stop matching at the first time it sees a "?>" other than the last time, which could produce unexpected results.


Waigani wrote:
worked out reg exp (I'm a newbie to reg exp) '/<\?.\?>/' should be '/<\?.+\?>/'



Waigani wrote:
no luck I get a "DOMXPath::query() [function.DOMXPath-query]: Invalid
expression in …" . Also I'm trying to grab the xml declaration with a reg
- as there has been no feed back on grabbing it with Zend Dom. The
following does not work:

$html = '<?xml version="1.0" encoding="iso-8859-1"?>';

$html = preg_replace( '/<\?.\?>/', 'replace xml', $html);

echo $html;

why does  '/<\?.\?>/' not work?


Waigani wrote:
I'm trying to select every element that has the string 'url' inside its
style attribute. The following does not work:
$dom->query('*[style*="url"]').



Reply via email to