-
-
Notifications
You must be signed in to change notification settings - Fork 814
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
Support glob patterns #97
Comments
Currently it is impossible to match arbitrary bytes with |
Thank you for your contribution! If I understand this correctly, this would basically be like find's How would glob-matching work, exactly?
As a side remark: we do have the |
Yes, the glob pattern is converted to a regex pattern, prefixed with '(?-u)' to match arbitrary bytes (not UTF-8 aware, but I removed it in the patch).
Not working well currently, I just saw that flag. Glob pattern like
Omitted too. :P |
Oh, there is no conflict between |
PS. The syntax for globs: https://docs.rs/globset/0.2.0/globset/#syntax |
Thank you for the clarification.
Could you please explain this in more detail? I'm not familiar with |
Ref: https://doc.rust-lang.org/regex/regex/index.html#grouping-and-flags |
Sorry to be pedantic, but what does this mean, exactly? Do we need Unicode to be disabled to match files with UTF-8-broken filenames? |
Different file systems have different result for creating files with arbitrary bytes. Some will keep any byte (except NUL and "/"). On MacOS's HFS+, invalid bytes are escaped like URI special chars, e.g. 0xE4 becomes With Unicode support, the empty pattern "" or "^" and the likes can match all files, while "^.*$" or more complex ones may not. I think it is fine to enable Unicode support for glob patterns, if
What if we want to check for file paths with invalid bytes? Just do a subtraction on sets:
EDIT: s/rfind/fd/ |
The command for checking can be simplified to |
I see the feature has been added to a fork, but not here? |
Tracking #96
Add the flag --glob to take
<pattern>
as a glob pattern. And --regex to override --glob.The text was updated successfully, but these errors were encountered: