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 Escape Sequence
  4. JS: Unicode Escape Sequence
  5. JS: String Object
  6. JS: String.prototype
  7. JS: String to Number
  8. JS: Encode URL, Escape String
  9. JS: Format Number
  10. JS: JSON
  11. JS: Source Code Encoding
  12. JS: Allowed Characters in Identifier

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

If you have a question, put $5 at patreon and message me.

Web Dev Tutorials

  1. HTML
  2. Visual CSS
  3. JS Basics
  4. JS in Depth
  5. JS Reference
  6. DOM
  7. SVG
  8. JS Misc