Java.Util.Regex.IMatchResult.Group Method
Returns the text that matched a given group of the regular expression.

Syntax

[Android.Runtime.Register("group", "(I)Ljava/lang/String;", "GetGroup_IHandler:Java.Util.Regex.IMatchResultInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public string Group (int group)

Parameters

group
the group, ranging from 0 to groupCount() - 1, with 0 representing the whole pattern.

Returns

Documentation for this section has not yet been entered.

Remarks

Returns the text that matched a given group of the regular expression.

Explicit capturing groups in the pattern are numbered left to right in order of their opening parenthesis, starting at 1. The special group 0 represents the entire match (as if the entire pattern is surrounded by an implicit capturing group). For example, "a((b)c)" matching "abc" would give the following groups:

java Example

 0 "abc"
 1 "bc"
 2 "b"
 

An optional capturing group that failed to match as part of an overall successful match (for example, "a(b)?c" matching "ac") returns null. A capturing group that matched the empty string (for example, "a(b?)c" matching "ac") returns the empty string.

[Android Documentation]

Requirements

Namespace: Java.Util.Regex
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1