JavaScript: RegExp Object
RegExp
is the value of the property key "RegExp"
of the Global Object
.
console.log( window.RegExp === RegExp );
Type
Type of RegExp
is a function.
// type of RegExp console.log( typeof RegExp === "function" );
Parent
Parent of RegExp
is Function.prototype.
console.log( Reflect.getPrototypeOf ( RegExp ) === Function.prototype );
Purpose
Purpose of RegExp
is:
- To create instance of βRegExpβ objects. RegExp is used to pattern match strings, or find string patterns, or do string replacement by pattern.
- Holds the property key
"prototype"
. The value ofRegExp.prototype
is the parent object of all regexp instances.
Constructor
Properties
JavaScript Regular Expression
- RegExp Tutorial
- RegExp Functions
- RegExp Syntax
- RegExp Flags
- Replacement String Dollar Sign Sequence
- Replacement Function Arguments