I'm trying to strip comments from a CSS file using sed
. I'm using macOS, and normalize.css as a test file.
So far, I have this:
sed -E 's,\/\*[^*]*\*+([^/*][^*]*\*+)*\/,,g' < normalize.css > normalize.min.css
This does not work whatsoever; all the comments remain in the resulting normalize.min.css
file.
I'm taking the regex from the CSS comments spec.
I've also tried it without substitute:
sed -E '/\/\*[^*]*\*+([^/*][^*]*\*+)*\//d' < normalize.css > normalize.min.css
With no luck.
Any help would be very much appreciated. Thanks!