JS: RegExp (class)
What is the Keyword “RegExp”
RegExp is the value of the property key "RegExp" of the Global Object
.
console.assert(globalThis["RegExp"] === RegExp);
Type
Type of RegExp is a function.
// type of RegExp console.assert(typeof RegExp === "function");
Parent
Parent of RegExp is Function.prototype.
console.assert(Reflect.getPrototypeOf(RegExp) === Function.prototype);
Purpose
Purpose of RegExp is:
- To create RegExp objects.
- Used as a namespace to hold static methods.
- Holds the property key
"prototype". Its value is the parent of all instance of regex.
Constructor
Properties
JavaScript. Regular Expression
- JS: Regular Expression Tutorial
- JS: Regular Expression Functions
- JS: Create Regex Object
- JS: Regular Expression Syntax
- JS: Regular Expression Flags
- JS: Regex Replace String Dollar Sign
- JS: Regex Replace Function Args
- JS: RegExp (class)
- JS: RegExp Constructor
- JS: RegExp.prototype
- JS: String.prototype.search
- JS: String.prototype.match
- JS: String.prototype.matchAll
- JS: String.prototype.replace
- JS: String.prototype.replaceAll
- JS: RegExp.prototype.test
- JS: RegExp.prototype.exec