Compartir a través de


Matcher.GroupCount Method

Definition

Returns the number of capturing groups in this matcher's pattern.

[Android.Runtime.Register("groupCount", "()I", "")]
public int GroupCount ();
[<Android.Runtime.Register("groupCount", "()I", "")>]
abstract member GroupCount : unit -> int
override this.GroupCount : unit -> int

Returns

The number of capturing groups in this matcher's pattern

Implements

Attributes

Remarks

Returns the number of capturing groups in this matcher's pattern.

Group zero denotes the entire pattern by convention. It is not included in this count.

Any non-negative integer smaller than or equal to the value returned by this method is guaranteed to be a valid group index for this matcher.

Java documentation for java.util.regex.Matcher.groupCount().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to