poison the request was asking for coments # and // not / /
fixed the bug you found in mine havent added / / comments but it would be quite simple to do so
this will not remove coments o first line of code tho
<?php
$txt='$cache .= "blahblahblahblahblahblah;
//my comment
$cache .=$bl#ah.$blah; //dhhdhh
$cache .=$bl//ah.$blah;
#another comment
$cache .= $blah;';
$txt1=preg_replace("/((;\).*|\n)(\\/\\/|#).*\n/","$2\n",$txt);
$code1=preg_replace('/^\\s*?(\\#|\\/\\/).*$/smi', '', $txt);
$code2=preg_replace('/\\/\\*.*?\\*\//smi', '', $txt);
echo "<pre>txt1
".$txt1."</pre>";
echo "<pre>code1
".$code1."</pre>";
echo "<pre>code2
".$code2."</pre>";
?>
output
txt1
$cache .= "blahblahblahblahblahblah;
$cache .=$bl#ah.$blah;
$cache .=$bl//ah.$blah;
$cache .= $blah;
code1
$cache .= "blahblahblahblahblahblah;
code2
$cache .= "blahblahblahblahblahblah;
//my comment
$cache .=$bl#ah.$blah; //dhhdhh
$cache .=$bl//ah.$blah;
#another comment
$cache .= $blah;
looks like yours need some more work good luck