| Crates.io | yash-fnmatch |
| lib.rs | yash-fnmatch |
| version | 1.1.2 |
| created_at | 2022-07-02 04:09:38.117169+00 |
| updated_at | 2024-12-14 02:52:21.318052+00 |
| description | POSIX-compatible pattern matching for globbing |
| homepage | |
| repository | https://github.com/magicant/yash-rs |
| max_upload_size | |
| id | 617634 |
| size | 113,267 |
yash-fnmatch is a Rust library crate for performing glob-style pattern
matching. This crate is part of yash, but can be used
independently.
This crate recognizes all the features of the pattern matching notation as defined in POSIX. However, this crate does not (yet) support any locale-dependent behaviors.
Add yash-fnmatch as a dependency in your Cargo.toml.
use yash_fnmatch::{Pattern, without_escape};
let p = Pattern::parse(without_escape("r*g")).unwrap();
assert_eq!(p.find("string"), Some(2..6));
MIT or Apache 2.0, at your option
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
yash-fnmatch is very similar to the
fnmatch-regex crate in that both
perform matching by converting the pattern to a regular expression.
yash-fnmatch tries to support the POSIX specification as much as possible
rather than introducing unique (non-portable) functionalities.