Closed
Description
What version of Go are you using (go version
)?
$ go version 1.20.1
Does this issue reproduce with the latest release?
not
What operating system and processor architecture are you using (go env
)?
go env
Output
$ go envGOHOSTARCH="amd64"
GOHOSTOS="darwin"
What did you do?
func replaceName(name string) {
reg := regexp.MustCompile(`[^a-zA-Z]gs_`)
if reg == nil {
return
}
if !reg.Match([]byte(name)) {
fmt.Println("name: ", name)
return
}
}
What did you expect to see?
input case: "gs_abc", "hellgs_"
output: "hellgs_"
What did you see instead?
input case: "gs_abc", "hellgs_"
output: "gs_abc", "hellgs_"