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/syntax: syntax.Regexp.String mishandles syntax.OneLine flag #12980

Closed
nvanbenschoten opened this issue Oct 18, 2015 · 2 comments
Closed

Comments

@nvanbenschoten
Copy link
Contributor

The lack of the OneLine syntax.Flag when parsing a syntax.Regexp should correspond to an m regexp flag, which defaults to false when compiling a regexp.Regexp if not present. The syntax.writeRegexp function should therefore add the m flag when it is needed. Instead, it looks like the writeRegexp function subtracts the m flag when it is not needed, which would be incorrect based on the default functionality.

Here is a Go Playground to demonstrate this.

@ianlancetaylor
Copy link
Contributor

CC @rsc

@gopherbot
Copy link

CL https://golang.org/cl/16112 mentions this issue.

@rsc rsc closed this as completed in 3aa755b Nov 25, 2015
gopherbot pushed a commit that referenced this issue Aug 16, 2016
Also includes a minor golint cleanup in the tests.

Change-Id: I8c0fc81479e635e7cca18d5c48c28b654afa59d8
Reviewed-on: https://go-review.googlesource.com/25380
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
@golang golang locked and limited conversation to collaborators Nov 27, 2016
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

3 participants