RegExp.prototype 属性表示 RegExp 构造函数的原型对象。
查看 RegExp 了解更多关于 RegExp 实例的说明。
RegExp 实例继承 RegExp.prototype。修改该原型对象上的属性或方法会影响到所有的 RegExp 实例。
注意,RegExp 对象的几个属性既有完整的长属性名,也有对应的类 Perl 的短属性名。两个属性都有着同样的值。JavaScript 的正则语法就是基于 Perl 的。
RegExp.prototype.constructorRegExp.prototype.globalRegExp.prototype.ignoreCaseRegExp.prototype.lastIndexRegExp.prototype.multilineRegExp.prototype.sourceRegExp.prototype.sticky Object:RegExp.prototype.exec()RegExp.prototype.test()RegExp.prototype.toSource() Object.prototype.toSource 方法.RegExp.prototype.toString()Object.prototype.toString() 方法。Object:| Specification | Status | Comment |
|---|---|---|
| ECMAScript 1st Edition. Implemented in JavaScript 1.1 | Standard | Initial definition. |
| ECMAScript 5.1 (ECMA-262) RegExp |
Standard | |
| ECMAScript 2015 (6th Edition, ECMA-262) RegExp.prototype |
Standard |
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) |
| Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|---|
| Basic support | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) | (Yes) |
RegExpFunction.prototype