Skip to content

Regexp package problem with "$" #596

@gopherbot

Description

@gopherbot

by kmkaplan:

Before filing a bug, please check whether it has been fixed since
the latest release: run "hg pull -u" and retry what you did to
reproduce the problem.  Thanks.

What steps will reproduce the problem?
1. compile this snippet:
package main
import ("fmt"; "regexp")
func main() {
    fmt.Println(regexp.MustCompile("AB$").MatchStrings("CAB"),
                regexp.MustCompile("AB$").MatchStrings("ACB"))
}

2. run it.
3. output is not as expected

What is the expected output?
I expect "[AB] []"

What do you see instead?
I get "[AB] [CB]"

What is your $GOOS?  $GOARCH?
GOARCH=amd64
GOOS=linux

Which revision are you using?  (hg identify)
db4262ce882d tip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions