java.util.regex
public interface: MatchResult [javadoc |
source]
All Known Implementing Classes:
Matcher, MatchResultImpl
Holds the results of a successful match of a
Pattern against a
given string. The result is divided into groups, with one group for each
pair of parentheses in the regular expression and an additional group for
the whole regular expression. The start, end, and contents of each group
can be queried.
Also see:
- Matcher
- Matcher#toMatchResult()
- author:
Nikolay - A. Kuznetsov
| Method from java.util.regex.MatchResult Detail: |
public int end()
Returns the index of the first character following the text that matched
the whole regular expression. |
public int end(int group)
Returns the index of the first character following the text that matched
a given group. |
public String group()
Returns the text that matched the whole regular expression. |
public String group(int group)
Returns the text that matched a given group of the regular expression. |
public int groupCount()
Returns the number of groups in the result, which is always equal to
the number of groups in the original regular expression. |
public int start()
Returns the index of the first character of the text that matched
the whole regular expression. |
public int start(int group)
Returns the index of the first character of the text that matched a given
group. |