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

proposal: regexp: add support to !re #46961

Closed
fidencio opened this issue Jun 29, 2021 · 4 comments
Closed

proposal: regexp: add support to !re #46961

fidencio opened this issue Jun 29, 2021 · 4 comments
Labels
FrozenDueToAge Proposal WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@fidencio
Copy link

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

$ go version
go1.16.4

Does this issue reproduce with the latest release?

There's no issue, this is a request for enhancement

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/fidencio/.cache/go-build"
GOENV="/home/fidencio/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/fidencio/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/fidencio/go"
GOPRIVATE=""
GOPROXY="direct"
GOROOT="/usr/lib/golang"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16.4"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
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-build3703314101=/tmp/go-build -gno-record-gcc-switches"

What do you want?

While there are workarounds for the behaviour I think that should be supported (as keeping allow and deny lists), I'd love to see the support for !re being introduced to the language.

This would allow things to be slightly simpler on the developer side.

@seankhliao
Copy link
Member

What exactly does "!re" refer to?

@seankhliao seankhliao added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jun 29, 2021
@seankhliao seankhliao changed the title RFE | regexp: Add support to !re proposal: regexp: Add support to !re Jun 29, 2021
@gopherbot gopherbot added this to the Proposal milestone Jun 29, 2021
@seankhliao seankhliao changed the title proposal: regexp: Add support to !re proposal: regexp: add support to !re Jun 29, 2021
@fidencio
Copy link
Author

What exactly does "!re" refer to?

@seankhliao, let me first say I'm taking https://github.com/google/re2/wiki/Syntax as a reference.
What I'm looking for is a way to support something that does not match a specific re (as in everything else but that).

So, for instance "!(foo)" would match anything else but "foo".
Is this, somehow, more clear?

Again, we could easily work this around with a deny list (instead of an allow list).

@seankhliao
Copy link
Member

Package regexp implements re2, any new language features would have to be accepted by re2 before it can be implemented here. google/re2#156 has indicated that it will not be supported.

Closing as there's nothing to do

@fidencio
Copy link
Author

@seankhliao, makes sense!

Thanks a whole lot for finding the pointer to the re2 issue, very much appreciated, and, at least, we have this archived for the next person who requests something similar.

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

No branches or pull requests

3 participants