regexp: bug fix: need to track whether match begins with fixed prefix.

Fixes #872.

R=rsc
CC=golang-dev
https://golang.org/cl/1731043
This commit is contained in:
Rob Pike 2010-06-22 16:02:14 -07:00
parent 537e5f4b7e
commit a8cd6c2012
2 changed files with 20 additions and 17 deletions

View file

@ -100,7 +100,8 @@ var matches = []tester{
// fixed bugs
tester{`ab$`, "cab", vec{1, 3}},
tester{`axxb$`, "axxcb", vec{}},
tester{`data`, "daXY data", vec{5, 9}},
tester{`da(.)a$`, "daXY data", vec{5, 9, 7, 8}},
// can backslash-escape any punctuation
tester{`\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\{\|\}\~`,