JavaScript RegExp constructor property
- Previous Page ?!
- Next Page global
- Go Up One Level JavaScript RegExp Reference Manual
Definition and usage
constructor
The property returns the function that creates the RegExp prototype.
For regular expressions, the constructor property returns:
function RegExp() { [native code] }
Instance
The constructor property returns the constructor function of the RegExp.
let pattern = /Hello World/g; let text = pattern.constructor;
Syntax
regexp.constructor
Return value
function RegExp() { [native code] }
Browser Support
constructor
Is ECMAScript1 (ES1) Feature.
All browsers fully support ES1 (JavaScript 1997):
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Support | Support | Support | Support | Support | Support |
- Previous Page ?!
- Next Page global
- Go Up One Level JavaScript RegExp Reference Manual