(?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 /*/
You don't need to write
[\s\t\r\n]
because\s
is shorthand for[ \t\r\n]
(also includes a few other whitespace characters you don't care about).You also don't need to escape
/
nor do you need to escape*
inside the character class, and not sure why you've got parentheses in there? :SActually, I'd probably just recommend using something like the YUI compressor, since that's built for this task and has already been extensively tested and so on.