Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Expression.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Expression.java	(revision 5700)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Expression.java	(revision 5701)
@@ -313,6 +313,6 @@
                 Matcher m = Pattern.compile(pattern, f).matcher(target);
                 if (m.matches()) {
-                    List result = new ArrayList(m.groupCount());
-                    for (int i=1; i<=m.groupCount(); i++) {
+                    List result = new ArrayList(m.groupCount() + 1);
+                    for (int i=0; i<=m.groupCount(); i++) {
                         result.add(m.group(i));
                     }
@@ -325,6 +325,6 @@
                 Matcher m = Pattern.compile(pattern).matcher(target);
                 if (m.matches()) {
-                    List result = new ArrayList(m.groupCount());
-                    for (int i=1; i<=m.groupCount(); i++) {
+                    List result = new ArrayList(m.groupCount() + 1);
+                    for (int i=0; i<=m.groupCount(); i++) {
                         result.add(m.group(i));
                     }
