diff --git a/README.markdown b/README.markdown index d0734d7..774a927 100644 --- a/README.markdown +++ b/README.markdown @@ -97,9 +97,10 @@ For more information: http://github.com/robertkrimen/otto/tree/master/underscore Go translates JavaScript-style regular expressions into something that is regexp package compatible. -Unfortunately, JavaScript has positive and negative lookahead, which is not supported by Go's re2-like engine: https://code.google.com/p/re2/wiki/Syntax +Unfortunately, JavaScript has positive lookahead, negative lookahead, and backreferencing, +all of which are not supported by Go's re2-like engine: https://code.google.com/p/re2/wiki/Syntax -A brief discussion of this limitation: "Regexp (?!re)" https://groups.google.com/forum/?fromgroups=#!topic/golang-nuts/7qgSDWPIh_E +A brief discussion of these limitations: "Regexp (?!re)" https://groups.google.com/forum/?fromgroups=#!topic/golang-nuts/7qgSDWPIh_E ### UTF-8 UTF-16 diff --git a/otto.go b/otto.go index 32a4bb2..b9f79a6 100644 --- a/otto.go +++ b/otto.go @@ -94,9 +94,10 @@ Regular Expression Syntax Go translates JavaScript-style regular expressions into something that is regexp package compatible. -Unfortunately, JavaScript has positive and negative lookahead, which is not supported by Go's re2-like engine: https://code.google.com/p/re2/wiki/Syntax +Unfortunately, JavaScript has positive lookahead, negative lookahead, and backreferencing, +all of which are not supported by Go's re2-like engine: https://code.google.com/p/re2/wiki/Syntax -A brief discussion of this limitation: "Regexp (?!re)" https://groups.google.com/forum/?fromgroups=#!topic/golang-nuts/7qgSDWPIh_E +A brief discussion of these limitations: "Regexp (?!re)" https://groups.google.com/forum/?fromgroups=#!topic/golang-nuts/7qgSDWPIh_E UTF-8 UTF-16 diff --git a/parser_test.go b/parser_test.go index fe39acd..b5ef0dd 100644 --- a/parser_test.go +++ b/parser_test.go @@ -1413,6 +1413,8 @@ Label '_' has already been declared Unexpected token ILLEGAL 0:0:0 `) + + test("/\\1/.source", "---\nInvalid regular expression: invalid escape sequence: `\\1`\n-:-:-") } func TestParseComment(t *testing.T) {