From: Rob Pike Date: Tue, 25 Mar 2014 00:19:25 +0000 (+1100) Subject: regexp/syntax: document the upper limit of n in x{n} X-Git-Tag: go1.3beta1~292 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=929ee59fce2a314a28a25629e6c99402ec97603e;p=gostls13.git regexp/syntax: document the upper limit of n in x{n} Fixes #7252. LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/77990044 --- diff --git a/src/pkg/regexp/syntax/doc.go b/src/pkg/regexp/syntax/doc.go index e52632ef72..8e72c90d3e 100644 --- a/src/pkg/regexp/syntax/doc.go +++ b/src/pkg/regexp/syntax/doc.go @@ -46,6 +46,10 @@ Repetitions: x{n,}? n or more x, prefer fewer x{n}? exactly n x +Implementation restriction: The counting forms x{n} etc. (but not the other +forms x* etc.) have an upper limit of n=1000. Negative or higher explicit +counts yield the parse error ErrInvalidRepeatSize. + Grouping: (re) numbered capturing group (submatch) (?Pre) named & numbered capturing group (submatch)