regexObj.test(str)

The test() method executes a search for a match between a regular expression and a specified string. Returns true or false.


regexObj.exec(str)

The exec() method executes a search for a match in a specified string. Returns a result array, or null.

If you are executing a match simply to find true or false, use the RegExp.prototype.test() method or the String.prototype.search() method.


str.search(regexp)

The search() method executes a search for a match between a regular expression and this String object.


str.match(regexp)

The match() method retrieves the matches when matching a string against a regular expression.


str.replace(regexp|substr, newSubstr|function)

The replace() method returns a new string with some or all matches of a pattern replaced by a replacement. The pattern can be a string or a RegExp, and the replacement can be a string or a function to be called for each match.


str.split([separator[, limit]])

The split() method splits a String object into an array of strings by separating the string into substrings.

results matching ""

    No results matching ""