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: simple Ruby regular expression doesn’t work #3451

Closed
gopherbot opened this issue Apr 1, 2012 · 5 comments
Closed

regexp: simple Ruby regular expression doesn’t work #3451

gopherbot opened this issue Apr 1, 2012 · 5 comments

Comments

@gopherbot
Copy link

by blake.mizerany:

I’ve been slowly working on migrating more of Heroku’s codebase over to Go. One of
my more Ruby-centric coworkers just wasted several hours today on Go’s lack of support
for this regular expression:

    var validRequest = regexp.MustCompile(`^/customer/(\w+)/(\w+)?authas=\1(&.*)?`)

After tweaking, I’ve narrowed it down to this minimal repro case:

   var r = regexp.MustCompile(`^(a).+\1`)

That works fine in Ruby:

$ irb
>> "abba".match(/^(a).+\1/)
=> #<MatchData "abba" 1:"a">

Why doesn’t this work in Go?

Not to look a gift horse in the mouth, but I’ll have a harder time getting co-workers
to adopt Go if such basic things from Ruby aren’t even supported.
@bradfitz
Copy link
Contributor

bradfitz commented Apr 1, 2012

Comment 1:

Sorry!  Here's a fix: http://golang.org/cl/5971058/

@dsymonds
Copy link
Contributor

dsymonds commented Apr 1, 2012

Comment 2:

This is a little embarrassing, for sure. How can people take Go seriously?

Labels changed: added priority-asap, packagebug, expertneeded, performance, removed priority-triage.

Owner changed to @bradfitz.

Status changed to Started.

@rsc
Copy link
Contributor

rsc commented Apr 2, 2012

Comment 3:

Status changed to Fixed.

@bradfitz
Copy link
Contributor

bradfitz commented Apr 2, 2012

Comment 4:

I promised Blaked to update this bug, for the record, that he is not an idiot, and will
not be banned from the Go community.
Thanks for playing along, Blake!

Labels changed: added aprilfools.

@cznic
Copy link
Contributor

cznic commented Apr 2, 2012

Comment 5:

;-)

@golang golang locked and limited conversation to collaborators Jun 24, 2016
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

5 participants