从HTML中删除条件语句/ xml [重复]

This question already has an answer here:

I'm trying to remove the conditional comment statements and any XML content with the conditional statements from a HTML page, I'm using the below PHP but it doesn't seem to be remove the conditional statements and XML content, are the regex statements valid!?

HTML

...
<link rel=File-List href="filelist.xml">
<!--[if gte mso 9]><xml>
 <o:DocumentProperties>
  <o:Revision>3</o:Revision>
  <o:TotalTime>1</o:TotalTime>
  <o:Created>2014-02-14T21:30:00Z</o:Created>
  <o:LastSaved>2014-02-14T21:35:00Z</o:LastSaved>
  <o:Pages>1</o:Pages>
  <o:Words>58</o:Words>
  <o:Characters>331</o:Characters>
  <o:Lines>2</o:Lines>
  <o:Paragraphs>1</o:Paragraphs>
  <o:CharactersWithSpaces>388</o:CharactersWithSpaces>
  <o:Version>15.00</o:Version>
 </o:DocumentProperties>
 <o:OfficeDocumentSettings>
  <o:AllowPNG/>
 </o:OfficeDocumentSettings>
</xml><![endif]-->
<link rel=themeData href="themedata.tx">
...

PHP

$html = preg_replace('/<\?xml[^>]+\/>/im', '', $html);
$html = preg_replace('/<!--\[(.*)\]>/is', '', $html);
$html = preg_replace('/<!\[(.*)\]-->/is', '', $html);
</div>

Try this to match the complete conditional comment:

$html = preg_replace('/<!--\[if gte mso 9\]>.*<!\[endif\]-->/s', '', $html);

http://sandbox.onlinephpfunctions.com/code/e8a48984f34f2323ae14d72b7c33d3065edd00dc