diff --git a/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java b/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java
index 9e85e9b..b6f31f9 100644
--- a/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java
+++ b/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java
@@ -89,7 +89,8 @@ public class VpeStyleUtil {
 	/*
 	 * Pattern "|(//.*)" could be added at the end to remove single line comments.
 	 */
-	public static final Pattern CSS_COMMENT_PATTERN = Pattern.compile("(/\\*([^*]|["+LINE_SEPARATOR+"]|(\\*+([^*/]|["+LINE_SEPARATOR+"])))*\\*+/)"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ 
+	private static final String CSS_COMMENT_END = "*/"; //$NON-NLS-1$
+	private static final String CSS_COMMENT_START = "/*"; //$NON-NLS-1$
 	
 	public static String ATTR_URL = "url"; //$NON-NLS-1$
 	public static String OPEN_BRACKET = "("; //$NON-NLS-1$
@@ -949,12 +950,27 @@ public class VpeStyleUtil {
 	}
 	
 	/**
-	 * Removes all the CSS comments  from the text
+	 * Removes all the CSS comments from the text.
 	 * 
-	 * @param cssText the css text
+	 * @param css the CSS text
 	 * @return updated string
 	 */
 	public static String removeAllCssComments(String cssText) {
-		return CSS_COMMENT_PATTERN.matcher(cssText).replaceAll(Constants.EMPTY);
+		// It is too expensive to use regular expressions here, this is why they are not used. See JBIDE-12308
+		
+		StringBuilder cssBuilder = new StringBuilder(cssText);
+		int curIndex = 0;
+		int commentStartIndex;
+		while ((commentStartIndex = cssBuilder.indexOf(CSS_COMMENT_START, curIndex)) >= 0) {
+			int afterCommentEndIndex = cssBuilder.indexOf(CSS_COMMENT_END, commentStartIndex + CSS_COMMENT_START.length());
+			if (afterCommentEndIndex >= 0) {
+				afterCommentEndIndex += CSS_COMMENT_END.length();
+			} else {
+				afterCommentEndIndex = cssBuilder.length();
+			}
+			cssBuilder.replace(commentStartIndex, afterCommentEndIndex, " "); //$NON-NLS-1$
+			curIndex = commentStartIndex + 1;
+		}
+		return cssBuilder.toString();
 	}
 }
\ No newline at end of file
diff --git a/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/util/VpeStyleUtilTest.java b/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/util/VpeStyleUtilTest.java
new file mode 100644
index 0000000..acda856
--- /dev/null
+++ b/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/util/VpeStyleUtilTest.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ *     Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.editor.util;
+
+import junit.framework.TestCase;
+
+public class VpeStyleUtilTest extends TestCase {
+
+	@SuppressWarnings("nls")
+	public void testRemoveAllCssComments() {
+		assertEquals("", VpeStyleUtil.removeAllCssComments(""));
+		assertEquals(" ", VpeStyleUtil.removeAllCssComments("/*"));
+		assertEquals(" ", VpeStyleUtil.removeAllCssComments("/**/"));
+		assertEquals(" ", VpeStyleUtil.removeAllCssComments("/*/**/"));
+		assertEquals(" ", VpeStyleUtil.removeAllCssComments("/*//**/"));
+		assertEquals(" dddd ", VpeStyleUtil.removeAllCssComments("/*abcv*/dddd/**/"));
+		assertEquals("bvc dddd ", VpeStyleUtil.removeAllCssComments("bvc/*abcv*/dddd/**/"));
+		assertEquals("bvc dddd ", VpeStyleUtil.removeAllCssComments("bvc/*abcv*/dddd/*"));
+	}
+
+}
diff --git a/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/VpeAllImportantTests.java b/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/VpeAllImportantTests.java
index 6547d6f..47c4fa0 100644
--- a/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/VpeAllImportantTests.java
+++ b/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/test/VpeAllImportantTests.java
@@ -11,6 +11,7 @@
 package org.jboss.tools.vpe.test;
 
 import org.jboss.tools.vpe.editor.template.VpeTemplateManagerTest;
+import org.jboss.tools.vpe.editor.util.VpeStyleUtilTest;
 
 import junit.framework.Test;
 import junit.framework.TestSuite;
@@ -25,6 +26,7 @@ public class VpeAllImportantTests {
 	public static Test suite() {
 		TestSuite suite = new TestSuite(VpeAllImportantTests.class.getName());
 		//$JUnit-BEGIN$
+		suite.addTestSuite(VpeStyleUtilTest.class);
 		suite.addTestSuite(TemplateLoadingTest.class);
 		suite.addTestSuite(TemplateSchemeValidateTest.class);
 		suite.addTestSuite(TemplatesExpressionParsingTest.class);
