regexp: simple Ruby regular expression doesn’t work #3451
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.
The text was updated successfully, but these errors were encountered:
This issue was closed.