java.util.regex
Interface MatchResult

All Known Implementing Classes:
Matcher

public interface MatchResult

This interface represents the result of a regular expression match. It can be used to query the contents of the match, but not to modify them.

Since:
1.5

Method Summary
 int end()
          Returns the index just after the last matched character.
 int end(int group)
          Returns the index just after the last matched character of the given sub-match group.
 String group()
          Returns the substring of the input which was matched.
 String group(int group)
          Returns the substring of the input which was matched by the given sub-match group.
 int groupCount()
          Returns the number of sub-match groups in the matching pattern.
 int start()
          Returns the index of the first character of the match.
 int start(int group)
          Returns the index of the first character of the given sub-match group.
 

Method Detail

end

int end()
Returns the index just after the last matched character.


end

int end(int group)
Returns the index just after the last matched character of the given sub-match group.

Parameters:
group - the sub-match group

group

String group()
Returns the substring of the input which was matched.


group

String group(int group)
Returns the substring of the input which was matched by the given sub-match group.

Parameters:
group - the sub-match group

groupCount

int groupCount()
Returns the number of sub-match groups in the matching pattern.


start

int start()
Returns the index of the first character of the match.


start

int start(int group)
Returns the index of the first character of the given sub-match group.

Parameters:
group - the sub-match group