RegExp

@JSGlobal("RegExp") @native @JSType class RegExp extends StObject with RegExp
Companion
object
trait RegExp
trait StObject
class Object
trait Any
class Object
trait Matchable
class Any

Value members

Constructors

def this(pattern: String)
def this(pattern: RegExp)
def this(pattern: String, flags: String)
def this(pattern: RegExp, flags: String)

Inherited methods

def compile(): RegExp
Inherited from
RegExp
def exec(string: String): RegExpExecArray | Null

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

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

Value Params
string

The String object or string literal on which to perform the search.

Inherited from
RegExp
def hasOwnProperty(v: String): Boolean
Inherited from
Object
def isPrototypeOf(v: Object): Boolean
Inherited from
Object
def propertyIsEnumerable(v: String): Boolean
Inherited from
Object
def test(string: String): Boolean

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

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

Value Params
string

String on which to perform the search.

Inherited from
RegExp
def toLocaleString(): String
Inherited from
Object
def valueOf(): Any
Inherited from
Object

Inherited fields

@JSName
var `match`: Function1[String, RegExpMatchArray | Null]

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

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

Value Params
string

A string to search within.

Inherited from
RegExp
val dotAll: Boolean

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

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

Inherited from
RegExp
val flags: String

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:

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:

  • "g" for global
  • "i" for ignoreCase
  • "m" for multiline
  • "u" for unicode
  • "y" for sticky

If no flags are set, the value is the empty string.

Inherited from
RegExp
val global: Boolean

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

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

Inherited from
RegExp
val ignoreCase: Boolean

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

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

Inherited from
RegExp
var lastIndex: Double
Inherited from
RegExp
val multiline: Boolean

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

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

Inherited from
RegExp
@JSName
var replace: Function2[String, String, String] & Function2[String, Function2[String, Any, String], String]

Replaces text in a string, using this regular expression.

Replaces text in a string, using this regular expression.

Value Params
replacer

A function that returns the replacement text.

string

A String object or string literal whose contents matching against this regular expression will be replaced

Inherited from
RegExp
@JSName
var search: Function1[String, Double]

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

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

Value Params
string

The string to search within.

Inherited from
RegExp
val source: String

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.

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.

Inherited from
RegExp
@JSName
var split: Function2[String, UndefOr[Double], Array[String]]

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

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

If the regular expression contains capturing parentheses, then each time this regular expression matches, the results (including any undefined results) of the capturing parentheses are spliced.

Value Params
limit

if not undefined, the output array is truncated so that it contains no more than 'limit' elements.

string

string value to split

Inherited from
RegExp
val sticky: Boolean

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

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

Inherited from
RegExp
val unicode: Boolean

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

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

Inherited from
RegExp