FileDocCategorySizeDatePackage
MatchResult.javaAPI DocAndroid 1.5 API3070Wed May 06 22:41:04 BST 2009java.util.regex

MatchResult

public interface MatchResult
Holds the results of a successful match of a {@link 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.
see
Matcher
see
Matcher#toMatchResult()
since
Android 1.0

Fields Summary
Constructors Summary
Methods Summary
public intend()
Returns the index of the first character following the text that matched the whole regular expression.

return
the character index.
since
Android 1.0

public intend(int group)
Returns the index of the first character following the text that matched a given group.

param
group the group, ranging from 0 to groupCount() - 1, with 0 representing the whole pattern.
return
the character index.
since
Android 1.0

public java.lang.Stringgroup()
Returns the text that matched the whole regular expression.

return
the text.
since
Android 1.0

public java.lang.Stringgroup(int group)
Returns the text that matched a given group of the regular expression.

param
group the group, ranging from 0 to groupCount() - 1, with 0 representing the whole pattern.
return
the text that matched the group.
since
Android 1.0

public intgroupCount()
Returns the number of groups in the result, which is always equal to the number of groups in the original regular expression.

return
the number of groups.
since
Android 1.0

public intstart()
Returns the index of the first character of the text that matched the whole regular expression.

return
the character index.
since
Android 1.0

public intstart(int group)
Returns the index of the first character of the text that matched a given group.

param
group the group, ranging from 0 to groupCount() - 1, with 0 representing the whole pattern.
return
the character index.
since
Android 1.0