Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regexp: wrong matches when using Unicode character classes #32299

Closed
ghost opened this issue May 29, 2019 · 1 comment
Closed

regexp: wrong matches when using Unicode character classes #32299

ghost opened this issue May 29, 2019 · 1 comment

Comments

@ghost
Copy link

ghost commented May 29, 2019

What version of Go are you using (go version)?

$ go version
go version go1.12.5 linux/amd64

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/xxx/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/xxx/gocode"
GOPROXY=""
GORACE=""
GOROOT="/home/xxx/go"
GOTMPDIR=""
GOTOOLDIR="/home/xxx/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build004475749=/tmp/go-build -gno-record-gcc-switches"

What did you do?

https://play.golang.org/p/112417nrMlh

What did you expect to see?

FindAllString should return matches consisting either

  1. entirely of alphanumeric characters or

  2. entirely of non-alphanumeric characters, as in this example:

https://play.golang.org/p/wSTIJMabH5j

What did you see instead?

FindAllString returns the whole string as the only match.

@ghost ghost changed the title regexp: wrong submatches when using Unicode character classes regexp: wrong matches when using Unicode character classes May 29, 2019
@ghost
Copy link
Author

ghost commented May 29, 2019

False alarm. I used negated classes.

@ghost ghost closed this as completed May 29, 2019
@golang golang locked and limited conversation to collaborators May 28, 2020
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant