Chapter 1: Getting Started with Regex
A section in Chapter 1 introduces pattern flags as ignore case (
i), multiline (
m), and global match (
g). Another section describes using RegExp functions test() and exec() and using String functions replace(), search, and match.
RegExp discussed earlier in the chapter and at the same time provides a handy tool for testing regular expressions.
Chapter 2: The Basics
\d), word (
\w), and negated forms (
\W). It also explains and demonstrates specifying ranges, escaping hyphen, and negating ranges.
The "multipliers" section of the second chapter introduces the standard multipliers:
+ (one or more),
* (zero or more), and
? (zero or one). The chapter then describes and illustrates more customizable multipliers using curly brace syntax. Chapter 2 also introduces the regular expression pipe (alternation).
Chapter 3: Special Characters
The third chapter covers "more advanced techniques" associated with regular expressions: boundaries, nongreedy quantifiers, and groups. The chapter introduces "nonvisual constraints" such as the anchors caret (
^) for indicating the start of a line and dollar sign (
$) for indicating the end of a line. Other early chapter discussions involve matching word boundaries (
\b), matching non-word boundaries (
\B), and matching whitespace (
\s). Chapter 3's section on nongreedy quantifiers explains how to use the question mark (
?) to specify "ungreedy quantifiers."
?:), back references, lookahead groups (
?=), and negative lookahead (
Chapter 4: Regex in Practice
Chapter 5: Node.js and Regex
RegExp) that are "used to match or test a regular expression."