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

Unexpected escaping behavior #38

Open
aeneasr opened this issue Nov 14, 2019 · 1 comment
Open

Unexpected escaping behavior #38

aeneasr opened this issue Nov 14, 2019 · 1 comment

Comments

@aeneasr
Copy link

aeneasr commented Nov 14, 2019

Take the following code:

package main

import (
	"fmt"

	"github.com/gobwas/glob"
)

func main() {
	var g glob.Glob

	// create simple glob
	g = glob.MustCompile("foo\\bar")
	fmt.Printf("%+v", g.Match("foo\\bar"))
}

It returns false although I would expect true. Using fmt.Printf("%+v", g.Match("foobar")) return true, although I would expect false.

@aeneasr
Copy link
Author

aeneasr commented Nov 14, 2019

I understand now that \\b matches literal b. To achieve the above I would need to use foo\\\\bar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant