regexp: LiteralPrefix lies about completeness (original) (raw)

The following program fails with the panic:

package main

import "regexp"

func main() { re := regexp.MustCompile("^") prefix, complete := re.LiteralPrefix() if !complete && re.MatchString(prefix) { panic("bad") } }

If complete is false, Match must fail.

go version devel +b0532a9 Mon Jun 8 05:13:15 2015 +0000 linux/amd64