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: regexp.Compile() compile invalid regexp #21565

Closed
felipeweb opened this issue Aug 23, 2017 · 2 comments
Closed

regexp: regexp.Compile() compile invalid regexp #21565

felipeweb opened this issue Aug 23, 2017 · 2 comments

Comments

@felipeweb
Copy link

felipeweb commented Aug 23, 2017

Please answer these questions before submitting your issue. Thanks!

What did you do?

match string with this invalid regexp /files/instance/contas/export/*
https://play.golang.org/p/IY62eQqTKX

What did you expect to see?

err != nil and match == false

What did you see instead?

err == nil and match == true

System details

go version go1.8.3 darwin/amd64
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/felipeweb/Code/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.8.3/libexec"
GOTOOLDIR="/usr/local/Cellar/go/1.8.3/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/3c/3d8vk1ls4gggp0mq77yn19qm0000gn/T/go-build980377668=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
GOROOT/bin/go version: go version go1.8.3 darwin/amd64
GOROOT/bin/go tool compile -V: compile version go1.8.3 X:framepointer
uname -v: Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64
ProductName:	Mac OS X
ProductVersion:	10.12.6
BuildVersion:	16G29
lldb --version: lldb-370.0.37
  Swift-3.1
@felipeweb felipeweb changed the title regexp.Compile() compile invalid regexp regexp: regexp.Compile() compile invalid regexp Aug 23, 2017
@dcheney-atlassian
Copy link

This isn't an invalid regex, https://play.golang.org/p/VgCwQDuHeN

https://regex101.com/r/tfD68u/1

@dsnet
Copy link
Member

dsnet commented Aug 23, 2017

This is working as intended since /* literally means to match zero-or more / characters.

@dsnet dsnet closed this as completed Aug 23, 2017
@golang golang locked and limited conversation to collaborators Aug 23, 2018
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

4 participants