DBBroker.MATCH_REGEXP);
DBBroker.MATCH_REGEXP, flags);
    private Sequence evalWithIndex(Sequence contextSequence, Item contextItem, Sequence input) throws XPathException {        String pattern = getArgument(1).eval(contextSequence, contextItem).getStringValue();                int flags = 0;		if(getSignature().getArgumentCount() == 3)			flags = parseFlags(getArgument(2).eval(contextSequence, contextItem).getStringValue());		        NodeSet nodes = input.toNodeSet();                // get the type of a possible index		int indexType = nodes.getIndexType();		if(Type.subTypeOf(indexType, Type.STRING)) {		    DocumentSet docs = nodes.getDocumentSet();		    LOG.debug("Using index ...");		    try {				return context.getBroker().getValueIndex().match(docs, nodes, pattern, 						DBBroker.MATCH_REGEXP);			} catch (EXistException e) {				throw new XPathException(getASTNode(), e.getMessage(), e);			}		} else {		    ExtArrayNodeSet result = new ExtArrayNodeSet();		    for(Iterator i = nodes.iterator(); i.hasNext(); ) {		        NodeProxy node = (NodeProxy) i.next();		        if(match(node.getStringValue(), pattern, flags))		            result.add(node);		    }		    return result;		}    }