public class

MatchResult

extends JavaScriptObject
java.lang.Object
   ↳ com.google.gwt.core.client.JavaScriptObject
     ↳ com.google.gwt.regexp.shared.MatchResult

Class Overview

GWT wrapper for Javascript RegExp matching results.

Summary

Protected Constructors
MatchResult()
Public Methods
final String getGroup(int index)
Retrieves the matched string or the given matched group.
final int getGroupCount()
Returns the number of groups, including the matched string hence greater or equal than 1.
final int getIndex()
Returns the zero-based index of the match in the input string.
final String getInput()
Returns the original input string.
[Expand]
Inherited Methods
From class com.google.gwt.core.client.JavaScriptObject
From class java.lang.Object

Protected Constructors

protected MatchResult ()

Public Methods

public final 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 and getGroupCount() - 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 return null or an empty string.

public final int getGroupCount ()

Returns the number of groups, including the matched string hence greater or equal than 1.

public final int getIndex ()

Returns the zero-based index of the match in the input string.

public final String getInput ()

Returns the original input string.