(?s)\s|/\*.*?\*/
I've tested with ColdFusion 8 and Railo 3.3.
sCSSContent= sCCSContent.ReplaceAll( "(?s)\s|/\*.*?\*/" , "" );
/* Test 1 */
/* Test * / * 2 */
/* Test
. test
. test
test 3
*/
/* Test * / * 4 */ width: 0; /* Test 5 *//**/
/* Test 6 /*/
Ah, yes. It seems Java doesn't do negative groups. The idea behind the
[^(*/)]*
block is to ensure that the comment block stops at the first*\
, not some secondary comment close. For example,/* * / * */ width: 0; /**/
should turn intowidth:0;
.Nice to know about
\s
, I tend to overload the characters after dealing with quirky RegEx engines. I'll update the gist.