|-||myRegExp = new RegExp()|
|-||myRegExp = RegExp(aPattern)|
|-||myRegExp = RegExp(aPattern, someAttribs)|
|Argument list:||aPattern||A regular expression pattern|
|someAttribs||One or more regular expression attributes|
|Class properties:||$n, index, input, lastMatch, lastParen, leftContext, multiline, rightContext|
|Object properties:||$&, $', $*, $+, $_, $`, constructor, global, ignoreCase, index, lastIndex, prototype, source|
|Object methods:||compile(), exec(), test(), toSource(), toString()|
The RegExp object implements some class (or static) methods which is fairly untypical of classes that support a constructor. There are also instance methods and properties.
In Netscape Navigator, many properties of the RegExp built-in object are enumerable but they are not available in this way in MSIE.
IE 5 does not properly support the RegExp object on the Macintosh platform. Many properties such as lastMatch, leftContext, etc. return an undefined value regardless of the RegExp result.
// Create a RegExp object using a constructor var myRegExp = new RegExp("sque[ea]ky", "g"); // Create the same RegExp object with a reg exp literal var myRegExp = /sque[ea]ky/g;
ECMA 262 edition 3 - section - 220.127.116.11
ECMA 262 edition 3 - section - 15.10.3
ECMA 262 edition 3 - section - 15.10.4