Go backward to Match-zero-or-one Operator.
Go up to Repetition Operators.
Interval Operators (`{' ... `}' or `\{' ... `\}')
-------------------------------------------------
If the syntax bit `RE_INTERVALS' is set, then Regex recognizes
"interval expressions". They repeat the smallest possible preceding
regular expression a specified number of times.
If the syntax bit `RE_NO_BK_BRACES' is set, `{' represents the
"open-interval operator" and `}' represents the "close-interval
operator" ; otherwise, `\{' and `\}' do.
Specifically, supposing that `{' and `}' represent the open-interval
and close-interval operators; then:
`{COUNT}'
matches exactly COUNT occurrences of the preceding regular
expression.
`{MIN,}'
matches MIN or more occurrences of the preceding regular
expression.
`{MIN, MAX}'
matches at least MIN but no more than MAX occurrences of the
preceding regular expression.
The interval expression (but not necessarily the regular expression
that contains it) is invalid if:
* MIN is greater than MAX, or
* any of COUNT, MIN, or MAX are outside the range zero to
`RE_DUP_MAX' (which symbol `regex.h' defines).
If the interval expression is invalid and the syntax bit
`RE_NO_BK_BRACES' is set, then Regex considers all the characters in
the would-be interval to be ordinary. If that bit isn't set, then the
regular expression is invalid.
If the interval expression is valid but there is no preceding regular
expression on which to operate, then if the syntax bit
`RE_CONTEXT_INVALID_OPS' is set, the regular expression is invalid. If
that bit isn't set, then Regex considers all the characters--other than
backslashes, which it ignores--in the would-be interval to be ordinary.