Package org.apache.tools.ant.util.regexp
Interface RegexpMatcher
- All Known Subinterfaces:
- Regexp
- All Known Implementing Classes:
- JakartaOroMatcher,- JakartaOroRegexp,- JakartaRegexpMatcher,- JakartaRegexpRegexp,- Jdk14RegexpMatcher,- Jdk14RegexpRegexp
public interface RegexpMatcher
Interface describing a regular expression matcher.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intPerform a case insensitive matchstatic final intDefault Mask (case insensitive, neither multiline nor singleline specified).static final intTreat the input as a multiline inputstatic final intTreat the input as singleline input ('.' matches newline)
- 
Method SummaryModifier and TypeMethodDescriptionReturns a Vector of matched groups found in the argument using default options.Get the match groups from this regular expression.Get a String representation of the regexp patternbooleanDoes the given argument match the pattern?booleanDoes this regular expression match the input, given certain optionsvoidsetPattern(String pattern) Set the regexp pattern from the String description.
- 
Field Details- 
MATCH_DEFAULTstatic final int MATCH_DEFAULTDefault Mask (case insensitive, neither multiline nor singleline specified).- See Also:
 
- 
MATCH_CASE_INSENSITIVEstatic final int MATCH_CASE_INSENSITIVEPerform a case insensitive match- See Also:
 
- 
MATCH_MULTILINEstatic final int MATCH_MULTILINETreat the input as a multiline input- See Also:
 
- 
MATCH_SINGLELINEstatic final int MATCH_SINGLELINETreat the input as singleline input ('.' matches newline)- See Also:
 
 
- 
- 
Method Details- 
setPatternSet the regexp pattern from the String description.- Parameters:
- pattern- the pattern to match
- Throws:
- BuildException- on error
 
- 
getPatternGet a String representation of the regexp pattern- Returns:
- the pattern
- Throws:
- BuildException- on error
 
- 
matchesDoes the given argument match the pattern?- Parameters:
- argument- the string to match against
- Returns:
- true if the pattern matches
- Throws:
- BuildException- on error
 
- 
getGroupsReturns 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- the string to match against
- Returns:
- the vector of groups
- Throws:
- BuildException- on error
 
- 
matchesDoes this regular expression match the input, given certain options- Parameters:
- input- The string to check for a match
- options- The list of options for the match. See the MATCH_ constants above.
- Returns:
- true if the pattern matches
- Throws:
- BuildException- on error
 
- 
getGroupsGet the match groups from this regular expression. The return type of the elements is always String.- Parameters:
- input- The string to check for a match
- options- The list of options for the match. See the MATCH_ constants above.
- Returns:
- the vector of groups
- Throws:
- BuildException- on error
 
 
-