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

globset does not match non-ascii in character class #2873

Open
Dav1dde opened this issue Aug 14, 2024 · 0 comments
Open

globset does not match non-ascii in character class #2873

Dav1dde opened this issue Aug 14, 2024 · 0 comments

Comments

@Dav1dde
Copy link

Dav1dde commented Aug 14, 2024

The following code fails the assertion, where I would expect it to succeed.

assert!(globset::Glob::new("[ඞ]").unwrap().compile_matcher().is_match("ඞ"));

The problem appears to be the escaping here:

re.push_str(&char_to_escaped_literal(r.0));

I can PR this and remove the escaping if you think this is the correct fix. Although some escaping would still be necessary, for example for the pattern [\\], the \ still needs to be escaped.

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