throws Throwable
  private static Value pregReplace(Env env,                                   Value patternValue,                                   Value replacement,                                   String subject,                                   @Optional("-1") long limit,                                   Value countV)    throws Throwable  {    String string = subject;    if (limit < 0)      limit = Long.MAX_VALUE;    if (patternValue.isArray() && replacement.isArray()) {      ArrayValue patternArray = (ArrayValue) patternValue;      ArrayValue replacementArray = (ArrayValue) replacement;      Iterator<Value> patternIter = patternArray.values().iterator();      Iterator<Value> replacementIter = replacementArray.values().iterator();      while (patternIter.hasNext() && replacementIter.hasNext()) {        string = pregReplaceString(env,                                   patternIter.next().toString(),                                   replacementIter.next().toString(),                                   string,                                   limit,                                   countV).toString();      }    } else if (patternValue.isArray()) {      ArrayValue patternArray = (ArrayValue) patternValue;      for (Value value : patternArray.values()) {        string = pregReplaceString(env,                                   value.toString(),                                   replacement.toString(),                                   string,                                   limit,                                   countV).toString();      }    } else {      return pregReplaceString(env,			       patternValue.toString(),			       replacement.toString(),			       string,			       limit,			       countV);    }    return new StringValueImpl(string);  }