RegExp

external class RegExp(pattern: String, flags: String?)

Exposes the JavaScript RegExp object to Kotlin.

Constructors

RegExp
Link copied to clipboard
JS
fun RegExp(pattern: String, flags: String? = definedExternally)

Functions

exec
Link copied to clipboard
JS
fun exec(str: String): RegExpMatch?
test
Link copied to clipboard
JS
fun test(str: String): Boolean
toString
Link copied to clipboard
JS
open override fun toString(): String

Properties

global
Link copied to clipboard
JS
val global: Boolean
ignoreCase
Link copied to clipboard
JS
val ignoreCase: Boolean
lastIndex
Link copied to clipboard
JS
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
Link copied to clipboard
JS
val multiline: Boolean

Extensions

reset
Link copied to clipboard
JS
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.