Top Description Fields Methods
org.apache.tools.ant.util.regexp

public Interface Regexp

extends RegexpMatcher
Known Direct Implementers
org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp
Imports
org.apache.tools.ant.BuildException

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

Field Summary

Modifier and TypeField and Description
public static final int
REPLACE_ALL

Replace all occurrences of the regular expression

public static final int
REPLACE_FIRST

Replace only the first occurrence of the regular expression

Inherited from org.apache.tools.ant.util.regexp.RegexpMatcher:
MATCH_CASE_INSENSITIVEMATCH_DEFAULTMATCH_MULTILINEMATCH_SINGLELINE

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the result of the operation
substitute
(String
The string to substitute on
input
,
String
The string which defines the substitution
argument
,
int
The list of options for the match and replace. See the MATCH_ and REPLACE_ constants above.
options
)

Perform a substitution on the regular expression.

Inherited from org.apache.tools.ant.util.regexp.RegexpMatcher:
getGroupsgetGroupsgetPatternmatchesmatchessetPattern

Field Detail

REPLACE_ALLback to summary
public static final int REPLACE_ALL

Replace all occurrences of the regular expression

REPLACE_FIRSTback to summary
public static final int REPLACE_FIRST

Replace only the first occurrence of the regular expression

Method Detail

substituteback to summary
public String substitute(String input, String argument, int options) throws BuildException

Perform a substitution on the regular expression.

Parameters
input:String

The string to substitute on

argument:String

The string which defines the substitution

options:int

The list of options for the match and replace. See the MATCH_ and REPLACE_ constants above.

Returns:String

the result of the operation

Exceptions
BuildException:
on error