JS: RegExp Object

By Xah Lee. Date: . Last updated: .

RegExp is the value of the property key "RegExp" of the global object. [JS: the Global Object]

console.log( window["RegExp"] === RegExp ); // true

Type

RegExp is a function.

[see JS: Value Types]

// type of RegExp
console.log ( typeof RegExp === "function" ); // true

Parent

Parent of RegExp is Function.prototype. [see JS: Prototype and Inheritance]

// parent of RegExp
console.log ( Object.getPrototypeOf ( RegExp ) === Function.prototype ); // true

Purpose

Purpose of RegExp is:

  1. To create instance of “RegExp” objects. RegExp is used to pattern match strings, or find string patterns, or do string replacement by pattern.
  2. Holds the property key "prototype". The value of RegExp.prototype is the parent object of all regexp instances.

For a beginner tutorial, see JS: RegExp Tutorial

For a summary of regex methods, see JS: Regex Find/Replace

RegExp Constructor

JS: RegExp Constructor

Properties

Reference

ECMAScript® 2016 Language Specification#sec-regexp-regular-expression-objects

RegExp Topic

  1. JS: RegExp Tutorial
  2. JS: RegExp Syntax
  3. JS: Regex Find/Replace
  4. JS: RegExp Object
  5. JS: RegExp Constructor
  6. JS: RegExp.prototype

String Topic

  1. JS: String Overview
  2. JS: Template String
  3. JS: String Object
  4. JS: String.prototype
  5. JS: String Code Unit vs Code Point
  6. JS: String Escape Sequence
  7. JS: Unicode Escape Sequence
  8. JS: Source Code Encoding
  9. JS: Allowed Characters in Identifier
  10. JS: Convert String to Number
  11. JS: Encode URL, Escape String
  12. JS: Format Number
  13. JS: JSON

JS Object Reference

  1. Global
  2. Object
  3. Array
  4. Function
  5. String
  6. RegExp
  7. Date
  8. Set
  9. Map
  10. JSON
  11. Math
  12. Reflect
  13. Number
  14. Boolean
  15. Symbol
Liket it? Put $5 at patreon.

Or, Buy JavaScript in Depth

Patreon me $5. Ask me question on patreon