liveBook · Manning

Quantifier

A regular-expression quantifier is syntax that specifies how many times a preceding pattern element may or must match.

How 3 Manning books explain it

The Well-Grounded Rubyist, Fourth Edition

A regular-expression quantifier is a syntax element that specifies how many consecutive times a preceding pattern element may match.

How it is used
Constrains consecutive repetitions in Ruby regular expressions, complementing anchors that constrain match position and modifiers that change matching behavior.
How deep it goes
Works through shorthand and counted repetition, greediness, backtracking, and capture placement with match results.
Examples
Uses optional titles, flexible whitespace in a closing tag, digit runs, exclamation-delimited strings, and uppercase-group captures.
What you can do after
Apply it via Ruby regular expressions to specify optional, repeated, or bounded patterns and distinguish greedy from non-greedy matches.

Read how The Well-Grounded Rubyist, Fourth Edition explains quantifier →

Secrets of the JavaScript Ninja, Second Edition

A regular-expression operator that specifies how many times a preceding term may occur.

How it is used
Uses quantifiers to specify repetition of a preceding regular-expression term.
How deep it goes
Defines quantifiers by their repetition role but provides no visible syntax or mechanics.
What you can do after
Understand how a quantifier specifies repetition of a term in a regular expression.

Read how Secrets of the JavaScript Ninja, Second Edition explains quantifier →

Python How-To

A quantifier is a regular-expression construct that specifies how many occurrences of a preceding element may or must appear.

How it is used
Uses quantifiers to build regular-expression searches and extract values from text containing variable-length elements or separators.
How deep it goes
Defines six quantifier forms, demonstrates greedy and non-greedy matching, and stops short of regular-expression engine internals.
Examples
Demonstrates h and i repetitions, Python re.findall output, and extraction from values separated by one or more separators.
What you can do after
Apply it via Python regular expressions to match bounded, unbounded, greedy, or shortest variable-length sequences.

Read how Python How-To explains quantifier →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.