RegExp.$n (Property/static)

A property of the global RegExp object.


ECMAScript edition - 3
JavaScript - 1.2
JScript - 3.0
Internet Explorer - 4.0
Netscape - 4.0
Netscape Enterprise Server - 3.0
Opera 5.0
JavaScript syntax:-RegExp.$1

There are nine similarly named properties whose name is a dollar symbol followed by a single digit, each of these holding text matched by a sub-expression (in parentheses) for the most recent match.

The ECMAScript edition 3 specification suggests that the range of values for this is $01 to $99 and for an implementation to be ECMA compliant, it should support that range of possibilities. as well as the $1 to $9 values.


See also:RegExp pattern - grouping, RegExp pattern - references, RegExp.exec(), RegExp.test()

Property attributes:



ECMA 262 edition 3 - section -