java.util.regex

Interface MatchResult

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
intend()
Returns the index just after the last matched character.
intend(int group)
Returns the index just after the last matched character of the given sub-match group.
Stringgroup()
Returns the substring of the input which was matched.
Stringgroup(int group)
Returns the substring of the input which was matched by the given sub-match group.
intgroupCount()
Returns the number of sub-match groups in the matching pattern.
intstart()
Returns the index of the first character of the match.
intstart(int group)
Returns the index of the first character of the given sub-match group.

Method Detail

end

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

end

public 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

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

group

public 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

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

start

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

start

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

Parameters: group the sub-match group