org.apache.tools.ant.util.regexp

Interface Regexp

All Superinterfaces:
RegexpMatcher
Known Implementing Classes:
JakartaOroRegexp, JakartaRegexpRegexp, Jdk14RegexpRegexp

public interface Regexp
extends RegexpMatcher

Interface which represents a regular expression, and the operations that can be performed on it.

Field Summary

static int
REPLACE_ALL
Replace all occurances of the regular expression
static int
REPLACE_FIRST
Replace only the first occurance of the regular expression

Fields inherited from interface org.apache.tools.ant.util.regexp.RegexpMatcher

MATCH_CASE_INSENSITIVE, MATCH_DEFAULT, MATCH_MULTILINE, MATCH_SINGLELINE

Method Summary

String
substitute(String input, String argument, int options)
Perform a substitution on the regular expression.

Methods inherited from interface org.apache.tools.ant.util.regexp.RegexpMatcher

getGroups, getGroups, getPattern, matches, matches, setPattern

Field Details

REPLACE_ALL

public static final int REPLACE_ALL
Replace all occurances of the regular expression
Field Value:
16

REPLACE_FIRST

public static final int REPLACE_FIRST
Replace only the first occurance of the regular expression
Field Value:
1

Method Details

substitute

public String substitute(String input,
                         String argument,
                         int options)
            throws BuildException
Perform a substitution on the regular expression.
Parameters:
input - The string to substitute on
argument - The string which defines the substitution
options - The list of options for the match and replace. See the MATCH_ and REPLACE_ constants above.
Returns:
the result of the operation
Throws:
BuildException - on error

Copyright B) 2000-2008 Apache Software Foundation. All Rights Reserved.