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
MATCH_DEFAULT
public static final int MATCH_DEFAULT
Default Mask (case insensitive, neither multiline nor
singleline specified).
MATCH_MULTILINE
public static final int MATCH_MULTILINE
Treat the input as a multiline input
MATCH_SINGLELINE
public static final int MATCH_SINGLELINE
Treat the input as singleline input ('.' matches newline)
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
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.
getPattern
public String getPattern()
throws BuildException
Get a String representation of the regexp pattern
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
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
setPattern
public void setPattern(String pattern)
throws BuildException
Set the regexp pattern from the String description.
pattern
- the pattern to match
Copyright B) 2000-2007 Apache Software Foundation. All Rights Reserved.