org.apache.tools.ant.util.regexp
Interface RegexpMatcher
- Regexp
- JakartaOroMatcher, JakartaOroRegexp, JakartaRegexpMatcher, JakartaRegexpRegexp, Jdk14RegexpMatcher, Jdk14RegexpRegexp
public interface RegexpMatcher
Interface describing a regular expression matcher.
Vector | getGroups(String argument) - Returns a Vector of matched groups found in the argument
using default options.
|
Vector | getGroups(String input, int options) -
Get the match groups from this regular expression.
|
String | getPattern() - Get a String representation of the regexp pattern
|
boolean | matches(String argument) - Does the given argument match the pattern?
|
boolean | matches(String input, int options) -
Does this regular expression match the input, given
certain options
|
void | setPattern(String pattern) - Set the regexp pattern from the String description.
|
MATCH_CASE_INSENSITIVE
public static final int MATCH_CASE_INSENSITIVE
Perform a case insenstive match
- 256
MATCH_DEFAULT
public static final int MATCH_DEFAULT
Default Mask (case insensitive, neither multiline nor
singleline specified).
- 0
MATCH_MULTILINE
public static final int MATCH_MULTILINE
Treat the input as a multiline input
- 4096
MATCH_SINGLELINE
public static final int MATCH_SINGLELINE
Treat the input as singleline input ('.' matches newline)
- 65536
getGroups
public Vector 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.
argument
- the string to match against
- the vector of groups
BuildException
- on error
getGroups
public Vector getGroups(String input,
int options)
throws BuildException
Get the match groups from this regular expression. The return
type of the elements is always String.
input
- The string to check for a matchoptions
- The list of options for the match. See the
MATCH_ constants above.
- the vector of groups
BuildException
- on error
getPattern
public String getPattern()
throws BuildException
Get a String representation of the regexp pattern
- the pattern
BuildException
- on error
matches
public boolean matches(String argument)
throws BuildException
Does the given argument match the pattern?
argument
- the string to match against
- true if the pattern matches
BuildException
- on error
matches
public boolean matches(String input,
int options)
throws BuildException
Does this regular expression match the input, given
certain options
input
- The string to check for a matchoptions
- The list of options for the match. See the
MATCH_ constants above.
- true if the pattern matches
BuildException
- on error
setPattern
public void setPattern(String pattern)
throws BuildException
Set the regexp pattern from the String description.
pattern
- the pattern to match
BuildException
- on error
Copyright B) 2000-2005 Apache Software Foundation. All Rights Reserved.