From: Rob Pike Date: Mon, 9 Aug 2010 22:11:02 +0000 (-0700) Subject: regexp: document that backslashes are the escape character. X-Git-Tag: weekly.2010-08-11~25 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=46db2e3c25f417008d2e639781169702104a9ef2;p=gostls13.git regexp: document that backslashes are the escape character. Fixes #1013. R=rsc, gri CC=golang-dev https://golang.org/cl/1938041 --- diff --git a/src/pkg/regexp/regexp.go b/src/pkg/regexp/regexp.go index 4dd430ea69..aa90eb321b 100644 --- a/src/pkg/regexp/regexp.go +++ b/src/pkg/regexp/regexp.go @@ -16,8 +16,14 @@ // '$' // '.' // character -// '[' [ '^' ] character-ranges ']' +// '[' [ '^' ] { character-range } ']' // '(' regexp ')' +// character-range: +// character '-' character +// +// All characters are UTF-8-encoded code points. +// Backslashes escape special characters, including inside +// character classes. // package regexp