[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
13.2.6 Numeric quantifiers
You can use braces to specify much finer-tuned quantification than is
possible with *
, +
, ?
.
The quantifier {m}
matches exactly m
instances of the preceding subpattern. m
must be a nonnegative integer.
The quantifier {m,n}
matches at least m
and at most
n
instances. m
and n
are nonnegative integers with
m <= n
. You may omit either or both numbers, in which case
m
defaults to 0 and n
to infinity.
It is evident that +
and ?
are abbreviations for
{1,}
and {0,1}
respectively. *
abbreviates
{,}
, which is the same as {0,}
.
(pregexp-match "[aeiou]{3}" "vacuous") ⇒ ("uou") (pregexp-match "[aeiou]{3}" "evolve") ⇒ #f (pregexp-match "[aeiou]{2,3}" "evolve") ⇒ #f (pregexp-match "[aeiou]{2,3}" "zeugma") ⇒ ("eu")
This document was generated on March 31, 2014 using texi2html 5.0.