public class JavaRegexpMatcher extends Object implements RegexpMatcher
MATCH_CASE_INSENSITIVE, MATCH_DEFAULT, MATCH_MULTILINE, MATCH_SINGLELINE| Constructor and Description |
|---|
JavaRegexpMatcher()
Constructor for JakartaOroRegexp
|
| Modifier and Type | Method and Description |
|---|---|
protected Pattern |
getCompiledPattern(int options)
Get a compiled representation of the regexp pattern
|
protected int |
getCompilerOptions(int options)
Convert the generic options to the regex compiler specific options.
|
Vector<String> |
getGroups(String argument)
Returns a Vector of matched groups found in the argument
using default options.
|
Vector<String> |
getGroups(String input,
int options)
Returns a Vector of matched groups found in the argument.
|
String |
getPattern()
Get a String representation of the regexp pattern
|
boolean |
matches(String argument)
Does the given argument match the pattern using default options?
|
boolean |
matches(String input,
int options)
Does the given argument match the pattern?
|
void |
setPattern(String pattern)
Set the regexp pattern from the String description.
|
public void setPattern(String pattern)
setPattern in interface RegexpMatcherpattern - the pattern to matchpublic String getPattern()
getPattern in interface RegexpMatcherorg.apache.tools.ant.BuildException - on errorprotected Pattern getCompiledPattern(int options) throws RuntimeException
options - the optionsorg.apache.tools.ant.BuildException - on errorRuntimeExceptionpublic boolean matches(String argument) throws RuntimeException
matches in interface RegexpMatcherargument - the string to match againstorg.apache.tools.ant.BuildException - on errorRuntimeExceptionpublic boolean matches(String input, int options) throws RuntimeException
matches in interface RegexpMatcherinput - the string to match againstoptions - the regex options to useorg.apache.tools.ant.BuildException - on errorRuntimeExceptionpublic Vector<String> getGroups(String argument) throws RuntimeException
Group 0 will be the full match, the rest are the parenthesized subexpressions
.getGroups in interface RegexpMatcherargument - the string to match againstorg.apache.tools.ant.BuildException - on errorRuntimeExceptionpublic Vector<String> getGroups(String input, int options) throws RuntimeException
Group 0 will be the full match, the rest are the parenthesized subexpressions
.getGroups in interface RegexpMatcherinput - the string to match againstoptions - the regex options to useorg.apache.tools.ant.BuildException - on errorRuntimeExceptionprotected int getCompilerOptions(int options)
options - the generic optionsCopyright © 2001–2025. All rights reserved.