Skip to content

Regexp can't handle lazy quantifiers #351

@gopherbot

Description

@gopherbot

by ibw@isaacwagner.me:

Before filing a bug, please check whether it has been fixed since
the latest release: run "hg pull -u" and retry what you did to
reproduce the problem.  Thanks.

What steps will reproduce the problem?
1. cat <<EOF > code.go
package main

import "regexp"

func main() {

    regexp.MustCompile("STRING\\(.*?\\) STRING\\(.*?\\)");
}
EOF
2. Build and run

What is the expected output? What do you see instead?
This would be expected to build and run properly (with no output of 
course).

Instead, the following runtime error occurs.

What is your $GOOS?  $GOARCH?
linux
386

Which revision are you using?  (hg identify)
cf1a9b1f9bee+ tip

Please provide any additional information below.

I have created a simple fix and submitted the change for review.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions