From: Rob Pike Date: Tue, 25 Mar 2014 00:17:30 +0000 (+1100) Subject: regexp: document that it is linear in the input size. X-Git-Tag: go1.3beta1~293 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c790b029e6a6478819c0ad611fb649d6b99f62ce;p=gostls13.git regexp: document that it is linear in the input size. Fixes #7488. LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/78050043 --- diff --git a/src/pkg/regexp/regexp.go b/src/pkg/regexp/regexp.go index 04818794cf..cca21e750e 100644 --- a/src/pkg/regexp/regexp.go +++ b/src/pkg/regexp/regexp.go @@ -11,6 +11,14 @@ // For an overview of the syntax, run // godoc regexp/syntax // +// The regexp implementation provided by this package is +// guaranteed to run in time linear in the size of the input. +// (This is a property not guaranteed by most open source +// implementations of regular expressions.) For more information +// about this property, see +// http://swtch.com/~rsc/regexp/regexp1.html +// or any book about automata theory. +// // All characters are UTF-8-encoded code points. // // There are 16 methods of Regexp that match a regular expression and identify