A regular expression object contains the pattern of a regular expression. It has properties and methods for using that regular expression to find and replace matches in strings.
In addition to the properties of an individual regular expression object that you create using the
RegExp constructor function, the predefined
RegExp object has static properties that are set whenever any regular expression is used.
A literal text format or the
RegExp constructor function.
The literal format is used as follows:
The constructor function is used as follows:
new RegExp("pattern"[, "flags"])