Share via


Matcher.End Method

Definition

Overloads

End()

Returns the offset after the last character matched.

End(Int32)

Returns the offset after the last character of the subsequence captured by the given group during the previous match operation.

End(String)

Returns the offset after the last character of the subsequence captured by the given named-capturing group during the previous match operation.

End()

Returns the offset after the last character matched.

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

Returns

The offset after the last character matched

Implements

Attributes

Exceptions

if no successful match has been made.

Remarks

Returns the offset after the last character matched.

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

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

End(Int32)

Returns the offset after the last character of the subsequence captured by the given group during the previous match operation.

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

Parameters

group
Int32

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

Returns

The offset after the last 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 offset after the last character 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.end(0) is equivalent to m.end().

Java documentation for java.util.regex.Matcher.end(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

End(String)

Returns the offset after the last character of the subsequence captured by the given named-capturing group during the previous match operation.

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

Parameters

name
String

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

Returns

The offset after the last character captured by the group, or -1 if the match was successful but the group itself did not match anything

Attributes

Remarks

Returns the offset after the last character 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.end(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