A quantifier is a regular-expression operator that specifies how many times the preceding term may occur. Operators qualify terms; quantifiers apply that role to repetition. section 10.2.2
Quantifier
A regular-expression operator that specifies how many times a preceding term may occur.
How Secrets of the JavaScript Ninja, Second Edition covers it
- 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.
- How it connects
- Connects quantifiers to regular expressions, terms, and operators.
Also explained in
-
The Well-Grounded Rubyist, Fourth EditionA regular-expression quantifier is a syntax element that specifies how many consecutive times a preceding pattern element may match.
-
Secrets of the JavaScript Ninja, Third EditionA repetition operator is a regular-expression quantifier that specifies how many times a preceding pattern may occur.
-
Python How-ToA quantifier is a regular-expression construct that specifies how many occurrences of a preceding element may or must appear.
Compare how 4 books explain quantifier →
Related concepts
- regular expressionpart of · A regular expression is a formal pattern notation that describes sets of strings and specifies how text can be matched, searched, or transformed.
- greedy matchingincludes · Greedy matching is regular-expression behavior in which a quantifier matches as much text as possible while still allowing the overall pattern to match.
- non-greedy quantifierincludes · A non-greedy quantifier matches the fewest repetitions that allow the entire regular expression to match.
- regex termuses · A regex term is a component of a regular expression, such as a literal, character class, or group, that contributes to the pattern being matched.
This explainer was generated by Manning's knowledge graph from the text of Secrets of the JavaScript Ninja, Second Edition. The section links point to the parts of the book it draws on.



