JavaScript - RegExp methods

revision:


list of RegExp methods and description.

compile() : (re-)compiles a regular expression during execution of a script. Deprecated.

exec() : executes a search for a match in its string parameter.

test() : tests for a match in its string parameter.

toSource() : returns an object literal representing the specified object; you can use this value to create a new object.

toString() : returns a string representing the specified object.

[@@match]() : performs match to given string and returns match result.

[@@matchAll]() : returns all matches of the regular expression against a string.

[@@replace]() : replaces matches in given string with new substring.

[@@search]() : searches the match in given string and returns the index the pattern found in the string.

[@@split]() : splits given string into an array by separating the string into substrings.