An intrinsic global object that stores information about the results of regular expression pattern matches.
The required property argument can be any one of the
RegExp object properties.
RegExp object cannot be created directly, but is always available for use. Until a successful regular expression search has been completed, the initial values of the various properties of the
RegExp object are as follows:
|$1 - $9||$1 - $9||Empty string.|
Its properties have undefined as their value until a successful regular expression search has been completed.
RegExp object should not be confused with the Regular Expression object. Even though they sound like the same thing, they are separate and distinct. The properties of the global
RegExp object contain continually updated information about each match as it occurs, while the properties of the Regular Expression object contain only information about the matches that occur with that instance of the Regular Expression.
The following example performs a regular expression search. It displays matches and submatches from the global
RegExp object, and from the array that is returned by the
RegExp object has no methods.
Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards, Internet Explorer 10 standards, Internet Explorer 11 standards. Also supported in Store apps (Windows 8 and Windows Phone 8.1). See Version Information.