Package com.google.gwt.regexp.shared
Class MatchResult
- java.lang.Object
-
- com.google.gwt.regexp.shared.MatchResult
-
public class MatchResult extends java.lang.ObjectPure Java implementation of a regular expression match result.
-
-
Constructor Summary
Constructors Constructor Description MatchResult(int index, java.lang.String input, java.util.List<java.lang.String> groups)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetGroup(int index)Retrieves the matched string or the given matched group.intgetGroupCount()Returns the number of groups, including the matched string hence greater or equal than 1.intgetIndex()Returns the zero-based index of the match in the input string.java.lang.StringgetInput()Returns the original input string.
-
-
-
Method Detail
-
getGroup
public java.lang.String getGroup(int index)
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() - 1included- Returns:
- The matched string if
indexis zero, else the given matched group. If the given group was optional and did not match, the behavior is browser-dependent: this method will returnnullor 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
public java.lang.String getInput()
Returns the original input string.
-
-