Fixes #12980.
Change-Id: I936db2f57f7c4dc80bb8ec32715c4c6b7bf0d708
Reviewed-on: https://go-review.googlesource.com/16112
Reviewed-by: Russ Cox <rsc@golang.org>
case OpAnyChar:
b.WriteString(`(?s:.)`)
case OpBeginLine:
- b.WriteRune('^')
+ b.WriteString(`(?m:^)`)
case OpEndLine:
- b.WriteRune('$')
+ b.WriteString(`(?m:$)`)
case OpBeginText:
b.WriteString(`\A`)
case OpEndText:
{`(ab)+`, `(ab)+`},
{`(ab)?`, `(ab)?`},
{`.`, `(?s:.)`},
- {`^`, `^`},
- {`$`, `$`},
+ {`^`, `(?m:^)`},
+ {`$`, `(?m:$)`},
{`[ac]`, `[ac]`},
{`[^ac]`, `[^ac]`},