* @return the result as a BooleanValue, or null to indicate the empty sequence
* @throws XPathException on an error
*/
public Item evaluateItem(XPathContext c) throws XPathException {
AtomicValue sv0 = (AtomicValue)argument[0].evaluateItem(c);
if (sv0==null) {
sv0 = StringValue.EMPTY_STRING;
}
AtomicValue pat = (AtomicValue)argument[1].evaluateItem(c);
if (pat==null) return null;
CharSequence flags;
if (argument.length==2) {
flags = "";
} else {
AtomicValue sv2 = (AtomicValue)argument[2].evaluateItem(c);
if (sv2==null) return null;
flags = sv2.getStringValueCS();
}
try {
ARegularExpression re = new ARegularExpression(pat.getStringValueCS(), flags.toString(), "XP20", null);
return BooleanValue.get(re.containsMatch(sv0.getStringValue()));