Package org.apache.tools.ant.util.regexp

Examples of org.apache.tools.ant.util.regexp.Regexp.matches()


      throw new BuildException( "Missing match in setregex" );
    }
    RegularExpression regularExpression = new RegularExpression();
    regularExpression.setPattern( match );
    Regexp regexp = regularExpression.getRegexp( getProject() );
    if (!regexp.matches( input, Regexp.MATCH_SINGLELINE )) {
      return;
    }
    String substituted = regexp.substitute( input, value, Regexp.MATCH_SINGLELINE );
    getProject().setProperty( property, substituted );
  }
View Full Code Here


        Regexp sregex = regexp.getRegexp(project);

        String output = null;

        if (sregex.matches(input, options))
            output = sregex.substitute(input,
                    replace.getExpression(getProject()),
                    options);

        if (output == null)
View Full Code Here

        Vector used = new Vector();

        while (e.hasMoreElements())
        {
            String key = (String) (e.nextElement());
            if (regex.matches(key, options))
            {
                String output = select;
                Vector groups = regex.getGroups(key, options);
                int sz = groups.size();
                for (int i = 0; i < sz; i++)
View Full Code Here

                               String input,
                               int options) {
        String res = input;
        Regexp regexp = r.getRegexp(getProject());

        if (regexp.matches(input, options)) {
            log("Found match; substituting", Project.MSG_DEBUG);
            res = regexp.substitute(input, s.getExpression(getProject()),
                                    options);
        }
View Full Code Here

                               String input,
                               int options) {
        String res = input;
        Regexp regexp = r.getRegexp(getProject());

        if (regexp.matches(input, options)) {
            res = regexp.substitute(input, s.getExpression(getProject()),
                                    options);
        }

        return res;
View Full Code Here

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

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

                               String input,
                               int options) {
        String res = input;
        Regexp regexp = r.getRegexp(getProject());

        if (regexp.matches(input, options)) {
            res = regexp.substitute(input, s.getExpression(getProject()),
                                    options);
        }

        return res;
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.