Search in sources :

Example 11 with RegularExpression

use of org.apache.tools.ant.types.RegularExpression in project ant by apache.

the class ReplaceRegExp method setMatch.

/**
 * the regular expression pattern to match in the file(s);
 * required if no nested <regexp> is used
 *
 * @param match the match attribute.
 */
public void setMatch(String match) {
    if (regex != null) {
        throw new BuildException("Only one regular expression is allowed");
    }
    regex = new RegularExpression();
    regex.setPattern(match);
}
Also used : RegularExpression(org.apache.tools.ant.types.RegularExpression) BuildException(org.apache.tools.ant.BuildException)

Aggregations

RegularExpression (org.apache.tools.ant.types.RegularExpression)11 BuildException (org.apache.tools.ant.BuildException)4 BufferedReader (java.io.BufferedReader)2 IOException (java.io.IOException)2 LineContainsRegExp (org.apache.tools.ant.filters.LineContainsRegExp)2 BufferedWriter (java.io.BufferedWriter)1 FileReader (java.io.FileReader)1 FileWriter (java.io.FileWriter)1 InputStreamReader (java.io.InputStreamReader)1 ArrayList (java.util.ArrayList)1 TokenFilter (org.apache.tools.ant.filters.TokenFilter)1 FilterChain (org.apache.tools.ant.types.FilterChain)1 RedirectorElement (org.apache.tools.ant.types.RedirectorElement)1 Regexp (org.apache.tools.ant.util.regexp.Regexp)1