Examples of RegularExpression


Examples of org.apache.tools.ant.types.RegularExpression

            }
            options = convertRegexOptions(flags);
            if (from == null) {
                throw new BuildException("Missing pattern in replaceregex");
            }
            regularExpression = new RegularExpression();
            regularExpression.setPattern(from);
            regexp = regularExpression.getRegexp(getProject());
            if (to == null) {
                to = "";
            }
View Full Code Here

Examples of org.apache.tools.ant.types.RegularExpression

            }
            options = convertRegexOptions(flags);
            if (from == null) {
                throw new BuildException("Missing from in containsregex");
            }
            regularExpression = new RegularExpression();
            regularExpression.setPattern(from);
            regexp = regularExpression.getRegexp(getProject());
            if (to == null) {
                return;
            }
View Full Code Here

Examples of org.apache.tools.ant.types.RegularExpression

            final int regexpsSize = regexps.size();

            for (line = readLine(); line != null; line = readLine()) {
                boolean matches = true;
                for (int i = 0; matches && i < regexpsSize; i++) {
                    RegularExpression regexp
                        = (RegularExpression) regexps.elementAt(i);
                    Regexp re = regexp.getRegexp(getProject());
                    matches = re.matches(line, regexpOptions);
                }
                if (matches ^ isNegated()) {
                    break;
                }
View Full Code Here

Examples of org.apache.tools.ant.types.RegularExpression

        Parameter[] params = getParameters();
        if (params != null) {
            for (int i = 0; i < params.length; i++) {
                if (REGEXP_KEY.equals(params[i].getType())) {
                    String pattern = params[i].getValue();
                    RegularExpression regexp = new RegularExpression();
                    regexp.setPattern(pattern);
                    regexps.addElement(regexp);
                } else if (NEGATE_KEY.equals(params[i].getType())) {
                    setNegate(Project.toBoolean(params[i].getValue()));
                } else if (CS_KEY.equals(params[i].getType())) {
                    setCaseSensitive(Project.toBoolean(params[i].getValue()));
View Full Code Here

Examples of org.apache.tools.ant.types.RegularExpression

        if (pattern != null) {
            return (SelectorUtils.matchPath(pattern, filename,
                                            casesensitive) == !(negated));
        } else {
            if (reg == null) {
                reg = new RegularExpression();
                reg.setPattern(regex);
                expression = reg.getRegexp(getProject());
            }
            int options = RegexpUtil.asOptions(casesensitive);
            return expression.matches(filename, options) == !negated;
View Full Code Here

Examples of org.apache.tools.ant.types.RegularExpression

    private boolean matches(String name) {
        if (pattern != null) {
            return SelectorUtils.match(modify(pattern), modify(name), cs);
        } else {
            if (reg == null) {
                reg = new RegularExpression();
                reg.setPattern(regex);
                expression = reg.getRegexp(project);
            }
            return expression.matches(modify(name), RegexpUtil.asOptions(cs));
        }
View Full Code Here

Examples of org.apache.tools.ant.types.RegularExpression

        if (r.isDirectory()) {
            return true;
        }

        if (myRegExp == null) {
            myRegExp = new RegularExpression();
            myRegExp.setPattern(userProvidedExpression);
            myExpression = myRegExp.getRegexp(getProject());
        }

        try {
View Full Code Here

Examples of org.apache.xerces.impl.validation.datatypes.regex.RegularExpression

            continue;
         }
         // next is $name
         String ithSubMatchName = (String) currentMatchSubParts.elementAt(i);
         Match m = new Match();
         RegularExpression re = (RegularExpression) ht.get(ithSubMatchName + "RE");
         if (re == null) {
            continue;
         }
         if (!re.matches(str, m)) {
            continue;
         }
         stack.insertElementAt(new NamedMatch(ithSubMatchName, m), 0);
         String result = getComponent(request);
         if (result != null) {
View Full Code Here

Examples of org.apache.xerces.impl.xpath.regex.RegularExpression

        // pattern
        if ((presentFacet & FACET_PATTERN) != 0) {
            if ((allowedFacet & FACET_PATTERN) == 0) {
                reportError("cos-applicable-facets", new Object[]{"pattern"});
            } else {
                RegularExpression regex = null;
                try {
                    regex = new RegularExpression(facets.pattern, "X");
                } catch (Exception e) {
                    reportError("InvalidRegex", new Object[]{facets.pattern, e.getLocalizedMessage()});
                }
                if (regex != null) {
                    fPattern = new Vector();
View Full Code Here

Examples of org.apache.xerces.impl.xpath.regex.RegularExpression

        } else {
            nvalue = content.toString();
        }

        if ( (fFacetsDefined & FACET_PATTERN ) != 0 ) {
            RegularExpression regex;
            for (int idx = fPattern.size()-1; idx >= 0; idx--) {
                regex = (RegularExpression)fPattern.elementAt(idx);
                if (!regex.matches(nvalue)){
                    throw new InvalidDatatypeValueException("cvc-pattern-valid",
                                                            new Object[]{content, regex});
                }
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.