Package client.net.sf.saxon.ce.regex

Examples of client.net.sf.saxon.ce.regex.ARegularExpression


            AtomicValue arg3 = (AtomicValue) argument[3].evaluateItem(c);
            flags = arg3.getStringValueCS();
        }

        try {
            ARegularExpression re = new ARegularExpression(arg1.getStringValueCS(), flags.toString(), "XP20", null);
            // check that it's not a pattern that matches ""
            if (re.matches("")) {
                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);
View Full Code Here


            sv = (AtomicValue)argument[2].evaluateItem(c);
            flags = sv.getStringValueCS();
        }

        try {
            ARegularExpression re = new ARegularExpression(pattern, flags.toString(), "XP20", null);

            // check that it's not a pattern that matches ""
            if (re.matches("")) {
                dynamicError("The regular expression in tokenize() must not be one that matches a zero-length string", "FORX0003", null);
            }

            return re.tokenize(input);

        } catch (XPathException err) {
            err.setErrorCode("FORX0002");
            err.setXPathContext(c);
            err.maybeSetLocation(this.getSourceLocator());
View Full Code Here

    private RegexIterator getRegexIterator(XPathContext context) throws XPathException {
        CharSequence input = select.evaluateAsString(context);

        String flagstr = flags.evaluateAsString(context).toString();
        ARegularExpression re = new ARegularExpression(regex.evaluateAsString(context), flagstr, "XP20", null);
        if (re.matches("")) {
            dynamicError("The regular expression must not be one that matches a zero-length string",
                    "XTDE1150", context);
        }

        return re.analyze(input);
    }
View Full Code Here

            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()));

        } catch (XPathException err) {
            XPathException de = new XPathException(err);
            de.maybeSetErrorCode("FORX0002");
            de.setXPathContext(c);
View Full Code Here

TOP

Related Classes of client.net.sf.saxon.ce.regex.ARegularExpression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.