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

public Interface RegexpMatcher

Known Direct Subinterfaces
org.apache.tools.ant.util.regexp.Regexp
Known Direct Implementers
org.apache.tools.ant.util.regexp.Jdk14RegexpMatcher
Imports
java.util.Vector, org.apache.tools.ant.BuildException

Interface describing a regular expression matcher.

Field Summary

Modifier and TypeField and Description
public static final int
MATCH_CASE_INSENSITIVE

Perform a case insensitive match

public static final int
MATCH_DEFAULT

Default Mask (case insensitive, neither multiline nor singleline specified).

public static final int
MATCH_MULTILINE

Treat the input as a multiline input

public static final int
MATCH_SINGLELINE

Treat the input as singleline input ('.' matches newline)

Method Summary

Modifier and TypeMethod and Description
public Vector<String>

Returns:

the vector of groups
getGroups
(String
the string to match against
argument
)

Returns a Vector of matched groups found in the argument using default options.

public Vector<String>

Returns:

the vector of groups
getGroups
(String
The string to check for a match
input
,
int
The list of options for the match. See the MATCH_ constants above.
options
)

Get the match groups from this regular expression.

public String

Returns:

the pattern
getPattern
()

Get a String representation of the regexp pattern

public boolean

Returns:

true if the pattern matches
matches
(String
the string to match against
argument
)

Does the given argument match the pattern?

public boolean

Returns:

true if the pattern matches
matches
(String
The string to check for a match
input
,
int
The list of options for the match. See the MATCH_ constants above.
options
)

Does this regular expression match the input, given certain options

public void
setPattern(String
the pattern to match
pattern
)

Set the regexp pattern from the String description.

Field Detail

MATCH_CASE_INSENSITIVEback to summary
public static final int MATCH_CASE_INSENSITIVE

Perform a case insensitive match

MATCH_DEFAULTback to summary
public static final int MATCH_DEFAULT

Default Mask (case insensitive, neither multiline nor singleline specified).

MATCH_MULTILINEback to summary
public static final int MATCH_MULTILINE

Treat the input as a multiline input

MATCH_SINGLELINEback to summary
public static final int MATCH_SINGLELINE

Treat the input as singleline input ('.' matches newline)

Method Detail

getGroupsback to summary
public Vector<String> getGroups(String argument) throws BuildException

Returns a Vector of matched groups found in the argument using default options.

Group 0 will be the full match, the rest are the parenthesized subexpressions

.
Parameters
argument:String

the string to match against

Returns:Vector<String>

the vector of groups

Exceptions
BuildException:
on error
getGroupsback to summary
public Vector<String> getGroups(String input, int options) throws BuildException

Get the match groups from this regular expression. The return type of the elements is always String.

Parameters
input:String

The string to check for a match

options:int

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

Returns:Vector<String>

the vector of groups

Exceptions
BuildException:
on error
getPatternback to summary
public String getPattern() throws BuildException

Get a String representation of the regexp pattern

Returns:String

the pattern

Exceptions
BuildException:
on error
matchesback to summary
public boolean matches(String argument) throws BuildException

Does the given argument match the pattern?

Parameters
argument:String

the string to match against

Returns:boolean

true if the pattern matches

Exceptions
BuildException:
on error
matchesback to summary
public boolean matches(String input, int options) throws BuildException

Does this regular expression match the input, given certain options

Parameters
input:String

The string to check for a match

options:int

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

Returns:boolean

true if the pattern matches

Exceptions
BuildException:
on error
setPatternback to summary
public void setPattern(String pattern) throws BuildException

Set the regexp pattern from the String description.

Parameters
pattern:String

the pattern to match

Exceptions
BuildException:
on error