java.util.regex
public final class Matcher extends Object implements MatchResult
Since: 1.4
| Method Summary | |
|---|---|
| Matcher | appendReplacement(StringBuffer sb, String replacement) |
| StringBuffer | appendTail(StringBuffer sb) |
| int | end() |
| int | end(int group) |
| boolean | find() |
| boolean | find(int start) |
| String | group() |
| String | group(int group) |
| int | groupCount() |
| boolean | hitEnd() |
| boolean | lookingAt() |
| boolean | matches()
Attempts to match the entire input sequence against the pattern.
|
| Pattern | pattern()
Returns the Pattern that is interpreted by this Matcher |
| String | replaceAll(String replacement) |
| String | replaceFirst(String replacement) |
| Matcher | reset() |
| Matcher | reset(CharSequence input) |
| int | start() |
| int | start(int group) |
| String | toString() |
Parameters: sb The target string buffer replacement The replacement string
Throws: IllegalStateException If no match has yet been attempted, or if the previous match operation failed IndexOutOfBoundsException If the replacement string refers to a capturing group that does not exist in the pattern
Parameters: sb The target string buffer
Throws: IllegalStateException If no match has yet been attempted, or if the previous match operation failed
Parameters: group The index of a capturing group in this matcher's pattern
Throws: IllegalStateException If no match has yet been attempted, or if the previous match operation failed IndexOutOfBoundsException If the replacement string refers to a capturing group that does not exist in the pattern
Parameters: start The index to start the new pattern matching
Throws: IndexOutOfBoundsException If the replacement string refers to a capturing group that does not exist in the pattern
Throws: IllegalStateException If no match has yet been attempted, or if the previous match operation failed
Parameters: group The index of a capturing group in this matcher's pattern
Throws: IllegalStateException If no match has yet been attempted, or if the previous match operation failed IndexOutOfBoundsException If the replacement string refers to a capturing group that does not exist in the pattern
Returns: True if and only if the matcher hit the end of input.
Parameters: replacement The replacement string
Parameters: replacement The replacement string
Parameters: input The new input character sequence
Throws: IllegalStateException If no match has yet been attempted, or if the previous match operation failed
UNKNOWN: the index of a capturing group in this matcher's pattern
Parameters: group The index of a capturing group in this matcher's pattern
Throws: IllegalStateException If no match has yet been attempted, or if the previous match operation failed IndexOutOfBoundsException If the replacement string refers to a capturing group that does not exist in the pattern
Returns: A string expression of this matcher.