"; // change the number to try the different regexes switch ($_GET['case']) { case 0: // breaks on my windows xp localhost, but works on my webspace $content = preg_replace('< \s*([@{}:;,]|\)\s|\s\()\s* | # Remove whitespace around separators, but keep space around parentheses. /\*([^*\\\\]|\*(?!/))+\*/ | # Remove comments that are not CSS hacks. [\n\r] # Remove line breaks. >x', '\1', $content); break; case 1: // breaks on my windows xp localhost, but works on my webspace $content = preg_replace('< /\*([^*\\\\]|\*(?!/))+\*/ >x', '\1', $content); break; case 2: // does not break, but does not remove any comments.. $content = preg_replace('< \s*([@{}:;,]|\)\s|\s\()\s* | # Remove whitespace around separators, but keep space around parentheses. # /\*([^*\\\\]|\*(?!/))+\*/ | # Remove comments that are not CSS hacks. [\n\r] # Remove line breaks. >x', '\1', $content); break; case 3: // does not break, but removes the comment that ends the ie5 mac hack $content = preg_replace('< \s*([@{}:;,]|\)\s|\s\()\s* | # Remove whitespace around separators, but keep space around parentheses. /\*[^*\\\\]*\*+([^/*][^*]*\*+)*/ | # Remove comments that are not CSS hacks. [\n\r] # Remove line breaks. >x', '\1', $content); break; case 4: // does not break, but leaves a crippled rest of the first comment. $content = preg_replace('< /\*[^*\\\\]*\*+([^/*][^*]*\*+)*/ | # Remove comments that are not CSS hacks. >x', '\1', $content); break; case 5: // does not break, but removes the ie5 mac hack $content = preg_replace('< /\*(.+?)(?x', '\1', $content); break; } echo $content; } echo "
done.";