A class that represents a regular expression.
// sample string containing some numbers
var string = "First Number: 1234; Second Number: 5678";
// regular expression to match whole numbers
var regex = new RegExp("[0-9]+","mg");
// find each regular expression match in the string
var result;
while ((result = regex.exec(string)) != null)
{
// if we have a match, do something
alert(result[0]);
}
Returns an Array containing the results of searching text for the regular expression. Returns null if no text match was found.
Searches the text for the string that the regular expression represents and returns the results in an Array. Returns null if no text match was found.
Returns true if the pattern matches, false otherwise.
Calling the test() method determines if the regular expression matches the string specified in the text parameter. If so, the call returns true. It is identical to "RegExp.exec(text) != null"
Returns a string containing the regular expression.
Returns a string that represents the regular expression.