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 issue #32086

Closed
SLusenti opened this issue May 16, 2019 · 5 comments
Closed

Regexp issue #32086

SLusenti opened this issue May 16, 2019 · 5 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@SLusenti
Copy link

SLusenti commented May 16, 2019

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

$ go version
go version go1.11.7 

Does this issue reproduce with the latest release?

this is the last version on fedora 29

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

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/slusenti/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/slusenti/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/lib/golang"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/golang/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-build237052522=/tmp/go-build -gno-record-gcc-switches"

What did you do?

just look at this code

reDash, _ := regexp.Compile("^:[ ]+[-]?(.*)[-]?$")
s := ": 7 this;is a test -"
s = reDash.ReplaceAllString(s, "$1")
print(s)
this;is a test -

What did you expect to see?

7 this;is a test -

it seems that it has no clue of the difference between numbers and spaces

What did you see instead?

this;is a test -
@ianlancetaylor
Copy link
Contributor

Please show us a complete example, ideally on https://play.golang.org. As far as I can tell your program works as expected.

@ianlancetaylor ianlancetaylor added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label May 16, 2019
@SLusenti
Copy link
Author

yeah , I've tested on the playground and it works well.
but if I run the same code on my fedora desktop I get "this;is a test -" instead of### "7 this;is a test -"

@agnivade
Copy link
Contributor

@SLusenti - I tried this on Ubuntu and it works fine. Would it be possible for you to show this using a docker image of Fedora 29 ?

@ianlancetaylor
Copy link
Contributor

You need to show us exactly what you are running.

@SLusenti
Copy link
Author

yeah,
now I've textsted on fedora30 with golang 1.12 and work fine thanks.

@golang golang locked and limited conversation to collaborators May 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants