RegExp

Constructors

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

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Returns a Boolean value indicating the state of the dotAll flag (s) used with a regular expression. Default is false. Read-only.

Link copied to clipboard

Returns a string indicating the flags of the regular expression in question. This field is read-only. The characters in this string are sequenced and concatenated in the following order:

Link copied to clipboard

Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only.

Link copied to clipboard

Returns a Boolean value indicating the state of the hasIndices flag (d) used with a regular expression. Default is false. Read-only.

Link copied to clipboard

Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only.

Link copied to clipboard
Link copied to clipboard

Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only.

Link copied to clipboard

Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal.

Link copied to clipboard

Returns a Boolean value indicating the state of the sticky flag (y) used with a regular expression. Default is false. Read-only.

Link copied to clipboard

Returns a Boolean value indicating the state of the Unicode flag (u) used with a regular expression. Default is false. Read-only.

Link copied to clipboard

Returns a Boolean value indicating the state of the unicodeSets flag (v) used with a regular expression. Default is false. Read-only.

Functions

Link copied to clipboard
open override fun [@@match](string: String): RegExpMatchArray?

Matches a string with this regular expression, and returns an array containing the results of that search.

Link copied to clipboard
open override fun [@@matchAll](string: String): JsIterable<RegExpExecArray>

Matches a string with this regular expression, and returns an iterable of matches containing the results of that search.

Link copied to clipboard
open override fun [@@replace](string: String, replacer: (substring: String) -> String): String
open override fun [@@replace](string: String, replaceValue: String): String

Replaces text in a string, using this regular expression.

Link copied to clipboard
open override fun [@@search](string: String): Int

Finds the position beginning first substring match in a regular expression search using this regular expression.

Link copied to clipboard
open override fun [@@split](string: String, limit: Int = definedExternally): ReadonlyArray<ERROR CLASS: Symbol not found for JsString>

Returns an array of substrings that were delimited by strings in the original input that match against this regular expression.

Link copied to clipboard
fun exec(string: String): RegExpExecArray?

Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search.

Link copied to clipboard
fun test(string: String): Boolean

Returns a Boolean value that indicates whether or not a pattern exists in a searched string.