RegExp

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

Exposes the JavaScript RegExp object to Kotlin.

Constructors

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

Functions

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

Properties

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

Extensions

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