]> Cypherpunks repositories - gostls13.git/commitdiff
regexp/syntax: document the upper limit of n in x{n}
authorRob Pike <r@golang.org>
Tue, 25 Mar 2014 00:19:25 +0000 (11:19 +1100)
committerRob Pike <r@golang.org>
Tue, 25 Mar 2014 00:19:25 +0000 (11:19 +1100)
Fixes #7252.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/77990044

src/pkg/regexp/syntax/doc.go

index e52632ef72686e0aa9349a76ee5da2bde7c65603..8e72c90d3ebb718f39551f99f3196f735c4a24b5 100644 (file)
@@ -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)
   (?P<name>re)   named & numbered capturing group (submatch)