}  if (! (matcher.find())) { return 0;
  public static int pregMatchAllPatternOrder(Env env,					     Pattern pattern,					     StringValue subject,					     ArrayValue matches,					     int flags,					     int offset)  {    Matcher matcher = pattern.matcher(subject);    if (! (matcher.find())) {      return 0;    }    int groupCount = matcher.groupCount();    ArrayValue []matchList = new ArrayValue[groupCount + 1];    for (int j = 0; j <= groupCount; j++) {      ArrayValue values = new ArrayValueImpl();      matches.put(values);      matchList[j] = values;    }    int count = 0;    do {      count++;      for (int j = 0; j <= groupCount; j++) {	ArrayValue values = matchList[j];	int start = matcher.start(j);	int end = matcher.end(j);	  	StringValue groupValue = subject.substring(start, end);	Value result = NullValue.NULL;	if (groupValue != null) {	  if ((flags & PREG_OFFSET_CAPTURE) != 0) {	    result = new ArrayValueImpl();	    result.put(groupValue);	    result.put(LongValue.create(start));	  } else {	    result = groupValue;	  }	}	values.put(result);      }    } while (matcher.find());    return count;  }