liveBook · Manning

One-or-more quantifier

A one-or-more quantifier is a regular-expression quantifier that requires the preceding element or group to occur at least once, with additional occurrences permitted.

How 2 Manning books explain it

Tiny Python Projects: Learn coding and testing with puzzles and games

A one-or-more quantifier is a regular-expression quantifier requiring the preceding element or group to occur at least once.

How it is used
Uses + to recognize repeated consonants, digits, word characters, and separators while building practical regular-expression solutions.
How deep it goes
Defines the quantifier and demonstrates successful, failed, captured, and split matches without examining regex-engine internals.
Examples
Demonstrates consonants in chair, digits in abc123!, word characters, vowel-word groups, and punctuation in a sentence.
What you can do after
Apply it via Python's re module to require and capture one or more consecutive characters or groups.

Read how Tiny Python Projects: Learn coding and testing with puzzles and games explains one-or-more quantifier →

The Quick Python Book, Fourth Edition

A one-or-more quantifier requires the preceding regular-expression element to occur at least once and permits additional occurrences.

How it is used
Uses `+` to require nonempty repeated portions when extracting names and matching structured text.
How deep it goes
Defines immediate-predecessor repetition and demonstrates character-class matching, but does not develop engine internals.
Examples
Demonstrates names, hyphenated names, overmatching strings, and Python `re` patterns for contact records.
What you can do after
Apply the quantifier in Python `re` patterns to match one or more characters or repeated subpatterns.

Read how The Quick Python Book, Fourth Edition explains one-or-more 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.