public class MatchResult extends JavaScriptObject
Modifier | Constructor and Description |
---|---|
protected |
MatchResult() |
Modifier and Type | Method and Description |
---|---|
String |
getGroup(int index)
Retrieves the matched string or the given matched group.
|
int |
getGroupCount()
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.
|
String |
getInput()
Returns the original input string.
|
cast, createArray, createArray, createFunction, createObject, equals, hashCode, toSource, toString
public final String getGroup(int index)
index
- the index of the group to return, 0 to return the whole
matched string; must be between 0 and getGroupCount() - 1
includedindex
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 return null
or an empty string.public final int getGroupCount()
public final int getIndex()
public final String getInput()
Copyright © 2018. All rights reserved.