throws Throwable
  public static Value split(Env env,                            String patternString,                            String string,                            @Optional("-1") long limit)    throws Throwable  {    if (limit < 0)      limit = Long.MAX_VALUE;    patternString = cleanRegexp(patternString, false);    Pattern pattern = Pattern.compile(patternString);    ArrayValue result = new ArrayValueImpl();    Matcher matcher = pattern.matcher(string);    long count = 0;    int head = 0;    while ((matcher.find()) && (count < limit)) {      String value;      if (count == limit - 1) {        value = string.substring(head);        head = string.length();      } else {        value = string.substring(head, matcher.start());        head = matcher.end();      }      result.put(new StringValueImpl(value));      count++;    }    if ((head <= string.length() && (count != limit))) {      result.put(new StringValueImpl(string.substring(head)));    }    return result;  }