throws Throwable
  private static Value pregReplaceCallback(Env env,                                           Value patternValue,                                           Callback fun,                                           String subject,                                           @Optional("-1") long limit,                                           @Optional @Reference Value countV)    throws Throwable  {    if (limit < 0)      limit = Long.MAX_VALUE;    if (patternValue.isArray()) {      ArrayValue patternArray = (ArrayValue) patternValue;      for (Value value : patternArray.values()) {        subject = pregReplaceCallbackImpl(env,                                          value.toString(),                                          fun,                                          subject,                                          limit,                                          countV);      }      return new StringValueImpl(subject);    } else if (patternValue instanceof StringValue) {      return new StringValueImpl(pregReplaceCallbackImpl(env,                                                     patternValue.toString(),                                                     fun,                                                     subject,                                                     limit,                                                     countV));    } else {      return NullValue.NULL;    }  }