Skip to content

Commit

Permalink
regexp/syntax: document the upper limit of n in x{n}
Browse files Browse the repository at this point in the history
Fixes #7252.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/77990044
  • Loading branch information
robpike committed Mar 25, 2014
1 parent c790b02 commit 929ee59
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pkg/regexp/syntax/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 929ee59

Please sign in to comment.