dynamicError(
"The regular expression in replace() must not be one that matches a zero-length string",
"FORX0003", c);
}
String input = arg0.getStringValue();
CharSequence res = re.replace(input, replacement);
return StringValue.makeStringValue(res);
} catch (XPathException err) {
XPathException de = new XPathException(err);
de.setErrorCode("FORX0002");
de.setXPathContext(c);