-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Closed as not planned
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.WorkingAsIntendedIssues describing something that is working as it is supposed to.Issues describing something that is working as it is supposed to.
Description
Go version
go version go1.24.2 linux/amd64
Output of go env in your module/workspace:
`go env` output
AR='ar'
CC='gcc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE='on'
GOAMD64='v1'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/home/me/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/home/me/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build3280803028=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/home/me/dev/github.com/gitleaks/gitleaks/go.mod'
GOMODCACHE='/home/me/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/rich/go'
GOPRIVATE=''
GOPROXY='direct'
GOROOT='/usr/lib/golang'
GOSUMDB='off'
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/me/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='local'
GOTOOLDIR='/usr/lib/golang/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.24.2'
GOWORK=''
PKG_CONFIG='pkg-config'What did you do?
I was writing test cases to detect "strange" character class ranges (i.e., a user does =-_ and inadvertently creates a range). It appears there is a bug with how syntax.Parse handles character ranges in conjunction with (?i).
https://go.dev/play/p/2p8l3zJi-4T
Note: [a-x] reference in the title refers to any range other than a-z.
What did you see happen?
The pattern (?i)[a-l0-9=-_] is parsed as a-z and not a-l as expected.
Pattern is: [0-9=-_a-zſK]
Pattern is: [0-9=A-L_a-lK]
Pattern is: [0-9=-_a-l]
Pattern is: [0-9=A-L_a-l]
What did you expect to see?
All patterns are printed as [a-l].
Pattern is: [0-9=-_a-lſK]
Pattern is: [0-9=A-L_a-lK]
Pattern is: [0-9=-_a-l]
Pattern is: [0-9=A-L_a-l]
Metadata
Metadata
Assignees
Labels
BugReportIssues describing a possible bug in the Go implementation.Issues describing a possible bug in the Go implementation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.WorkingAsIntendedIssues describing something that is working as it is supposed to.Issues describing something that is working as it is supposed to.