W3cubDocs

/Kotlin

RegExp

external class RegExp

Platform and version requirements: JS

Exposes the JavaScript RegExp object to Kotlin.

Constructors

<init>

RegExp(pattern: String, flags: String? = definedExternally)

Exposes the JavaScript RegExp object to Kotlin.

Properties

global

val global: Boolean

ignoreCase

val ignoreCase: Boolean

lastIndex

var lastIndex: Int

The lastIndex is a read/write integer property of regular expressions that specifies the index at which to start the next match.

multiline

val multiline: Boolean

Functions

exec

fun exec(str: String): RegExpMatch?

test

fun test(str: String): Boolean

toString

fun toString(): String

Returns a string representation of the object.

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:

Extension Functions

reset

fun RegExp.reset()

Resets the regular expression so that subsequent RegExp.test and RegExp.exec calls will match starting with the beginning of the input string.

© 2010–2017 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.js/-reg-exp/