JavaScript: RegExp Object

By Xah Lee. Date: . Last updated: .

RegExp is the value of the property key "RegExp" of the global object.

console.log( window.hasOwnProperty ( "RegExp" ) ) // true

RegExp is a function object.

〔►see JavaScript: Data Types

// type of RegExp
console.log ( typeof RegExp === "function" ); // true
console.log ( Object.prototype.toString.call(RegExp) === "[object Function]" ) // true

The parent of RegExp is Function.prototype. 〔►see JavaScript: Prototype and Inheritance

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

The 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.

〔►see JavaScript: RegExp Tutorial

RegExp Constructor

JavaScript: RegExp Constructor

Properties


RegExp.prototype

JavaScript: RegExp.prototype

Reference

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

RegExp Topic

  1. JavaScript: RegExp Tutorial
  2. JavaScript: String Methods for RegExp
  3. JavaScript: RegExp Object
  4. JavaScript: RegExp Constructor
  5. JavaScript: RegExp.prototype
  6. JavaScript: RegExp Syntax

String Topic

  1. JavaScript: Default Charset/Encoding
  2. JavaScript: String is 16-Bit Unit Sequence
  3. JavaScript: Unicode Character Escape Sequence
  4. JavaScript: Allowed Characters in Identifier
  5. HTML: Allowed Characters in id Attribute
  6. HTML: Character Sets and Encoding
  7. HTML XML Entities

  1. JavaScript: Template String
  2. JavaScript: Convert String to Number
  3. JavaScript Encode URL, Escape String
  4. JavaScript: Format Number
  5. JavaScript: JSON Object

  1. JavaScript: String Object
  2. JavaScript: String.prototype
  3. JavaScript: String Constructor

Object Reference

  1. JavaScript: Object Object
  2. JavaScript: Array Object
  3. JavaScript: Function Object
  4. JavaScript: String Object
  5. JavaScript: RegExp.prototype
  6. JavaScript: Date Object
  7. JavaScript: Set Object
  8. JavaScript: Map Object
  9. JavaScript: JSON Object
  10. JavaScript: Math Object
  11. JavaScript: Reflect Object
Like what you read? Buy JavaScript in Depth
or, buy a new keyboard, see Keyboard Reviews.