Author: dmaliarevich
Date: 2011-11-17 08:57:09 -0500 (Thu, 17 Nov 2011)
New Revision: 36405
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java
Log:
https://issues.jboss.org/browse/JBIDE-10178 - Java regexp pattern to match css path from
the url(..) construction was updated.
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java 2011-11-17
13:51:29 UTC (rev 36404)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java 2011-11-17
13:57:09 UTC (rev 36405)
@@ -73,7 +73,12 @@
public static final String EMPTY_STRING = ""; //$NON-NLS-1$
public static final String SINGLE_QUOTE_STRING = "\'"; //$NON-NLS-1$
public static final String QUOTE_STRING = "\""; //$NON-NLS-1$
-
+ /*
+ * Java regexp pattern to match css path from the url(..) construction.
+ * It's implied that the css string has only one URL in it.
+ */
+ public static final Pattern CSS_URL_PATTERN =
Pattern.compile("(?<=\\burl\\b)(?:[\\p{Space}]*\\()[\\p{Space}]*([^;]*)[\\p{Space}]*(?:\\)[\\p{Space}]*)(?=(?>[^\\)]*;|[^\\)]*))");
//$NON-NLS-1$
+
public static String ATTR_URL = "url"; //$NON-NLS-1$
public static String OPEN_BRACKET = "("; //$NON-NLS-1$
public static String CLOSE_BRACKET = ")"; //$NON-NLS-1$
@@ -493,11 +498,12 @@
*
https://issues.jboss.org/browse/JBIDE-10178
* The index of closing bracket was wrong.
* Thus replaced with java regexp.
+ */
+ Matcher m = CSS_URL_PATTERN.matcher(url);
+ String[] res = null;
+ /*
+ * It's implied that the "url" string has only one URL in it.
*/
- String urlRegExp = "(?<=\\burl\\b)\\((.*)\\)(?=(?>[^\\)]*;|[^\\)]*))";
//$NON-NLS-1$
- Pattern p = Pattern.compile(urlRegExp);
- Matcher m = p.matcher(url);
- String[] res = null;
if (m.find()) {
res = new String[3];
/*