- Java Regex - Discussion
- Java Regex - Useful Resources
- Java Regex - Quick Guide
- Java Regex - Logical Operators
- Java Regex - Possessive quantifiers
- Java Regex - Reluctant quantifiers
- Java Regex - Greedy quantifiers
- Java Regex - Boundary Matchers
- Unicode Character Classes
- Java Regex - JAVA Character Classes
- POSIX Character Classes
- Predefined Character Classes
- Java Regex - Character Classes
- Java Regex - Characters
- PatternSyntaxException Class
- Java Regex - Matcher Class
- Java Regex - Pattern Class
- Java Regex - MatchResult Interface
- Java Regex - Capturing Groups
- Java Regex - Overview
- Java Regex - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Java Regex - MatchResult Interface
Introduction
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.
Interface declaration
Following is the declaration for java.util.regex.MatchResult interface −
pubpc interface MatchResult
Interface methods
Sr.No | Method & Description |
---|---|
1 | Returns the offset after the last character matched. |
2 | Returns the offset after the last character of the subsequence captured by the given group during this match. |
3 | Returns the input subsequence matched by the previous match. |
4 | Returns the input subsequence captured by the given group during the previous match operation. |
5 | Returns the number of capturing groups in this match result s pattern. |
6 | Returns the start index of the match. |
7 | Returns the start index of the subsequence captured by the given group during this match. |