5 stable releases
1.1.2 | Dec 14, 2024 |
---|---|
1.1.1 | Apr 9, 2024 |
1.1.0 | Oct 21, 2022 |
1.0.1 | Oct 1, 2022 |
1.0.0 | Jul 2, 2022 |
#1245 in Command line utilities
888 downloads per month
Used in 4 crates
(via yash-semantics)
100KB
2.5K
SLoC
Yash-fnmatch
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.
Usage
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));
License
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.
Similar crates
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.
Dependencies
~2.4–4MB
~71K SLoC