Very Wierd... Your alterations work perfectly accept under one condition... Take a look at:
$_var = "TEST";
$_var1 = " TEST1";
$text = "<!--_var--><!--_var1-->";
//$text = "<!--_var-->,<!--_var1-->";
$x = preg_replace("/<!--(\S+)-->/e", "$\\1", $text);
echo $x;
The only way to make that work is to put an actual space between --> and <!--. It wont work with or without a character, it only likes the space. ... Any ideas?