}
	public Sequence eval(Sequence contextSequence, Item contextItem)		throws XPathException {		Sequence stringArg = getArgument(0).eval(contextSequence, contextItem);		if (stringArg.getLength() == 0)			return Sequence.EMPTY_SEQUENCE;		String string = stringArg.getStringValue();		String pattern =			getArgument(1).eval(contextSequence, contextItem).getStringValue();		int flags = 0;		if (getSignature().getArgumentCount() == 3)			flags =				parseFlags(					getArgument(2)						.eval(contextSequence, contextItem)						.getStringValue());		try {			if (prevPattern == null				|| (!pattern.equals(prevPattern))				|| flags != prevFlags)				pat = compiler.compile(pattern, flags);			prevPattern = pattern;			prevFlags = flags;			List result = new ArrayList(10);			Util.split(result, matcher, pat, string);			ValueSequence r = new ValueSequence();			for(int i = 0; i < result.size(); i++)				r.add(new StringValue((String)result.get(i)));			return r;		} catch (MalformedPatternException e) {			throw new XPathException("Invalid regular expression: " + e.getMessage(), e);		}	}