glob icon indicating copy to clipboard operation
glob copied to clipboard

"[]" and "?" don't match non-ascii characters

Open Khvalin opened this issue 5 years ago • 1 comments

Hello,

Consider the following code fragment. Neither [] nor ? seem to match a single character if it's outside the standard ASCII range.

package main

import "fmt"
import "github.com/gobwas/glob"

func main() {
	fmt.Println(glob.MustCompile("hell[o]").Match("hello"))        // true
	fmt.Println(glob.MustCompile("ångstr[ö]m").Match("ångström"))  // false

	fmt.Println(glob.MustCompile("hell?").Match("hello"))          // true
	fmt.Println(glob.MustCompile("ångstr?m").Match("ångström"))    // false
}

Thank you.

Khvalin avatar Apr 05 '20 23:04 Khvalin

I have same issue.

inliquid avatar Mar 27 '23 10:03 inliquid