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: FindAllStringIndex doesn't return overlapping matches #7643

Closed
gopherbot opened this issue Mar 26, 2014 · 2 comments
Closed

regexp: FindAllStringIndex doesn't return overlapping matches #7643

gopherbot opened this issue Mar 26, 2014 · 2 comments

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Mar 26, 2014

by vonosmas:

What does 'go version' print?
go version go1.2 darwin/amd64

What steps reproduce the problem?
http://play.golang.org/p/bcm1BeQ9r2
re := regexp.MustCompile("aaa")
fmt.Println(re.FindAllStringIndex("aaaaa", -1))

What happened?
program printed
[[0 3]]

What should have happened instead?
expected output:
[[0 3], [1 4], [2 5]]

Please provide any additional information below.
Even if this behavior is expected (which is somewhat counter-intuitive), it should be
documented at
http://golang.org/pkg/regexp/#Regexp.FindAllStringIndex
@gopherbot
Copy link
Author

@gopherbot gopherbot commented Mar 26, 2014

Comment 1 by vonosmas:

Sorry, this is documented indeed :(
Please mark this as Invalid and sorry for bothering.
@mikioh
Copy link
Contributor

@mikioh mikioh commented Mar 26, 2014

Comment 2:

Status changed to Invalid.

@gopherbot gopherbot added the invalid label Mar 26, 2014
@golang golang locked and limited conversation to collaborators Jun 25, 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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.