Skip to content

regexp: LiteralPrefix lies about completeness #11172

Closed
@dvyukov

Description

@dvyukov

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions