- Java Regex Tutorial
- Java Regex - Home
- Java Regex - Overview
- Java Regex - Capturing Groups
- Java Regex - MatchResult Interface
- Java Regex - Pattern Class
- Java Regex - Matcher Class
- PatternSyntaxException Class
- Java Regex Examples
- Java Regex - Characters
- Java Regex - Character Classes
- Predefined Character Classes
- POSIX Character Classes
- Java Regex - JAVA Character Classes
- Unicode Character Classes
- Java Regex - Boundary Matchers
- Java Regex - Greedy quantifiers
- Java Regex - Reluctant quantifiers
- Java Regex - Possessive quantifiers
- Java Regex - Logical Operators
- Java Regex Useful Resources
- Java Regex - Quick Guide
- Java Regex - Useful Resources
- Java Regex - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Java Regex - MatchResult Interface
The java.util.regex.MatchResult interface represents the result of a match operation. This interface contains query methods used to determine the results of a match against a regular expression. The match boundaries, groups and group boundaries can be seen but not modified through a MatchResult.
Following is the declaration for java.util.regex.MatchResult interface −
public interface MatchResult
|Sr.No||Method & Description|
Returns the offset after the last character matched.
|2||int end(int group)
Returns the offset after the last character of the subsequence captured by the given group during this match.
Returns the input subsequence matched by the previous match.
|4||String group(int group)
Returns the input subsequence captured by the given group during the previous match operation.
Returns the number of capturing groups in this match result's pattern.
Returns the start index of the match.
|7||int start(int group)
Returns the start index of the subsequence captured by the given group during this match.