public BooleanValue eval(Sequence<? extends Item> contextSeq, ValueSequence argv, DynamicContext dynEnv)
throws XQueryException {
final int arglen = argv.size();
Item firstItem = argv.getItem(0);
// If $input is the empty sequence, it is interpreted as the zero-length string.
String input = firstItem.isEmpty() ? "" : firstItem.stringValue();
Item secondItem = argv.getItem(1);
String pattern = secondItem.stringValue();
int flags = Pattern.UNIX_LINES;
if(arglen == 3) {
Item thirdItem = argv.getItem(2);