次の方法で共有


Matcher.Start Method

Definition

Overloads

Start()

Returns the start index of the previous match.

Start(Int32)

Returns the start index of the subsequence captured by the given group during the previous match operation.

Start(String)

Returns the start index of the subsequence captured by the given named-capturing group during the previous match operation.

Start()

Returns the start index of the previous match.

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

Returns

The index of the first character matched

Implements

Attributes

Exceptions

if no successful match has been made.

Remarks

Returns the start index of the previous match.

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

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

Start(Int32)

Returns the start index of the subsequence captured by the given group during the previous match operation.

[Android.Runtime.Register("start", "(I)I", "")]
public int Start (int group);
[<Android.Runtime.Register("start", "(I)I", "")>]
abstract member Start : int -> int
override this.Start : int -> int

Parameters

group
Int32

The index of a capturing group in this matcher's pattern

Returns

The index of the first character captured by the group, or -1 if the match was successful but the group itself did not match anything

Implements

Attributes

Exceptions

if no successful match has been made.

Remarks

Returns the start index of the subsequence captured by the given group during the previous match operation.

Capturing groups are indexed from left to right, starting at one. Group zero denotes the entire pattern, so the expression m.start(0) is equivalent to m.start().

Java documentation for java.util.regex.Matcher.start(int).

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

Start(String)

Returns the start index of the subsequence captured by the given named-capturing group during the previous match operation.

[Android.Runtime.Register("start", "(Ljava/lang/String;)I", "", ApiSince=26)]
public int Start (string name);
[<Android.Runtime.Register("start", "(Ljava/lang/String;)I", "", ApiSince=26)>]
member this.Start : string -> int

Parameters

name
String

The name of a named-capturing group in this matcher's pattern

Returns

The index of the first character captured by the group, or -1 if the match was successful but the group itself did not match anything

Attributes

Remarks

Returns the start index of the subsequence captured by the given named-capturing group during the previous match operation.

Added in 1.8.

Java documentation for java.util.regex.Matcher.start(java.lang.String).

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