How to strip html comments plus all tags inside it? Any idea how can I remove this in $vars['closure']; ?

&lt;!-- SiteCatalyst code version: H.19.4 Copyright 1997-2009 Omniture, Inc. More info available at http://www.omniture.com --&gt;
&lt;script type="text/javascript" language="JavaScript" src="/sites/all/themes/mytheme/js/s_code.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" language="JavaScript"&gt;&lt;!--
/************* DO NOT ALTER ANYTHING BELOW THIS LINE ! **************/
var s_code=s.t();if(s_code)document.write(s_code)//--&gt;&lt;/script&gt;
&lt;script language="JavaScript" type="text/javascript"&gt;&lt;!--
if(navigator.appVersion.indexOf('MSIE')&gt;=0)document.write(unescape('%3C')+'\!-'+'-')
//--&gt;&lt;/script&gt;&lt;noscript&gt;&lt;a href="http://www.omniture.com" title="Web Analytics"&gt;&lt;img src="http://server.122.2O7.net/b/ss/frisky/1/H.19.4--NS/0/4256542"
height="1" width="1" border="0" alt="" /&gt;&lt;/a&gt;&lt;/noscript&gt;&lt;!--/DO NOT REMOVE/--&gt;
&lt;!-- End SiteCatalyst code version: H.19.4 --&gt;


I tried the methods explained by kiamlaluno in this thread but I cant remove the above code in the view source using preg_replace but no luck.

//Remove omniture tags in unpublish node
  if(arg(0) == 'node' &amp;&amp; $vars['node']-&gt;status == 0) {
    $vars['closure'] = theme('closure');
    $omnitureTags = preg_replace( "/\&lt;!-- SiteCatalyst code version: H\.19\.4 Copyright 1997-2009.+\&lt;!-- End SiteCatalyst code version: H\.19\.4 --\&gt;/si", "", $vars['closure']);
    $vars['closure'] = $omnitureTags;
  } else {
    $vars['closure'] = theme('closure');
  }


The above code is now working according to what I need.
This is what theme_closure() does (in theme.inc):

function theme_closure($main = 0) {
  $footer = module_invoke_all('footer', $main);
  return implode("\n", $footer) . drupal_get_js('footer');
}


which means it's going to ask every module to run its footer hook plus get all the js to be put in the footer and return it:

$variables['closure'] = theme('closure');

to populate the closure variable.  So.... if you can't preg_replace() or regex() it out, why not just find what module is putting in there in the first place (seems pretty obvious) and kill it off there? 

EDIT/ADDITION:  IF it's a bug, fix it here, otherwise if it's just something you want different, preprocess it.  But it seems to me that a node status check might be in order in the module's footer hook.