public interface NamedGroupMatchResult extends MatchResult
| 限定符和类型 | 方法和说明 |
|---|---|
int |
end(String groupName)
Returns the offset after the last character of the subsequence
captured by the given named-capturing
group during the previous match operation.
|
String |
group(String groupName)
Returns the input subsequence captured by the given
named-capturing group during the previous
match operation.
|
List<Map<String,String>> |
namedGroups() |
List<String> |
names() |
int |
start(String groupName)
Returns the start index of the subsequence captured by the given
named-capturing group during the
previous match operation.
|
end, end, group, group, groupCount, start, startString group(String groupName)
If the match was successful but the group specified failed to match any part of the input sequence, then null is returned. Note that some groups, for example (a*), match the empty string. This method will return the empty string when such a group successfully matches the empty string in the input.
groupName - The name of a named-capturing group in this matcher's patternIllegalStateException - If no match has yet been attempted,
or if the previous match operation failedIllegalArgumentException - If there is no capturing group in the pattern
with the given nameint start(String groupName)
groupName - The name of a named-capturing group in this matcher's pattern-1 if the match was successful but the group
itself did not match anythingIllegalStateException - If no match has yet been attempted,
or if the previous match operation failedIllegalArgumentException - If there is no capturing group in the pattern
with the given nameint end(String groupName)
groupName - The name of a named-capturing group in this matcher's pattern-1 if the match was successful
but the group itself did not match anythingIllegalStateException - If no match has yet been attempted,
or if the previous match operation failedIllegalArgumentException - If there is no capturing group in the pattern
with the given nameCopyright © 2022. All rights reserved.