RegExpMatch

external interface RegExpMatch (source)

Platform and version requirements: JS

Represents the return value of RegExp.exec.

Properties

index

abstract val index: Int

input

abstract val input: String

length

abstract val length: Int

Inherited Functions

equals

open operator fun equals(other: Any?): Boolean

Indicates whether some other object is "equal to" this one. Implementations must fulfil the following requirements:

hashCode

open fun hashCode(): Int

Returns a hash code value for the object. The general contract of hashCode is:

toString

open fun toString(): String

Returns a string representation of the object.

Extension Functions

asArray

fun RegExpMatch.asArray(): Array<out String?>

Converts the result of RegExp.exec to an array where the first element contains the entire matched text and each subsequent element is the text matched by each capturing parenthesis.

get

operator fun RegExpMatch.get(index: Int): String?

Returns the entire text matched by RegExp.exec if the index parameter is 0, or the text matched by the capturing parenthesis at the given index.