Class JakartaRegexpRegexp
java.lang.Object
org.apache.tools.ant.util.regexp.JakartaRegexpMatcher
org.apache.tools.ant.util.regexp.JakartaRegexpRegexp
- All Implemented Interfaces:
Regexp, RegexpMatcher
Regular expression implementation using the Jakarta Regexp package
-
Field Summary
Fields inherited from interface Regexp
REPLACE_ALL, REPLACE_FIRSTModifier and TypeFieldDescriptionstatic final intReplace all occurrences of the regular expressionstatic final intReplace only the first occurrence of the regular expressionFields inherited from interface RegexpMatcher
MATCH_CASE_INSENSITIVE, MATCH_DEFAULT, MATCH_MULTILINE, MATCH_SINGLELINEModifier 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) -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intgetSubsOptions(int options) Convert ant regexp substitution option to apache regex options.substitute(String input, String argument, int options) Perform a substitution on the regular expression.Methods inherited from class JakartaRegexpMatcher
getCompiledPattern, getCompilerOptions, getGroups, getGroups, getPattern, matches, matches, setPatternModifier and TypeMethodDescriptionprotected org.apache.regexp.REgetCompiledPattern(int options) Compile the pattern.protected intgetCompilerOptions(int options) Convert the generic options to the regex compiler specific options.Returns a Vector of matched groups found in the argument using default options.Returns a Vector of matched groups found in the argument.Get a String representation of the regexp patternbooleanDoes the given argument match the pattern?booleanDoes the given argument match the pattern?voidsetPattern(String pattern) Set the regexp pattern from the String description.
-
Constructor Details
-
JakartaRegexpRegexp
public JakartaRegexpRegexp()
-
-
Method Details
-
getSubsOptions
protected int getSubsOptions(int options) Convert ant regexp substitution option to apache regex options.- Parameters:
options- the ant regexp options- Returns:
- the apache regex substitution options
-
substitute
Perform a substitution on the regular expression.- Specified by:
substitutein interfaceRegexp- Parameters:
input- The string to substitute onargument- The string which defines the substitutionoptions- The list of options for the match and replace.- Returns:
- the result of the operation
- Throws:
BuildException- on error
-