Package com.google.gwt.regexp.shared
Class MatchResult
java.lang.Object
com.google.gwt.regexp.shared.MatchResult
Pure Java implementation of a regular expression match result.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetGroup
(int index) Retrieves the matched string or the given matched group.int
Returns the number of groups, including the matched string hence greater or equal than 1.int
getIndex()
Returns the zero-based index of the match in the input string.getInput()
Returns the original input string.
-
Constructor Details
-
MatchResult
-
-
Method Details
-
getGroup
Retrieves the matched string or the given matched group.- Parameters:
index
- the index of the group to return, 0 to return the whole matched string; must be between 0 andgetGroupCount() - 1
included- Returns:
- The matched string if
index
is zero, else the given matched group. If the given group was optional and did not match, the behavior is browser-dependent: this method will returnnull
or an empty string.
-
getGroupCount
public int getGroupCount()Returns the number of groups, including the matched string hence greater or equal than 1. -
getIndex
public int getIndex()Returns the zero-based index of the match in the input string. -
getInput
Returns the original input string.
-