Closed wxiaoguang closed 1 month ago
regexp101 says: Golang \w match any word character in any script (equivalent to [\p{L}\p{N}_])
Golang \w match any word character in any script (equivalent to [\p{L}\p{N}_])
But Golang document says: \w : word characters (== [0-9A-Za-z_]) https://pkg.go.dev/regexp/syntax
\w : word characters (== [0-9A-Za-z_])
r := regexp.MustCompile(`\p{L}`) println(r.MatchString("α")) // true r = regexp.MustCompile(`\w`) println(r.MatchString("α")) // false
So the explanation equivalent to [\p{L}\p{N}_] is not right.
equivalent to [\p{L}\p{N}_]
Thanks, will be fixed in the next release
Bug Description
regexp101 says:
Golang \w match any word character in any script (equivalent to [\p{L}\p{N}_])
But Golang document says:
\w : word characters (== [0-9A-Za-z_])
https://pkg.go.dev/regexp/syntaxReproduction steps
So the explanation
equivalent to [\p{L}\p{N}_]
is not right.