4 stable releases

1.1.1 Apr 9, 2024
1.1.0 Oct 21, 2022
1.0.1 Oct 1, 2022
1.0.0 Jul 2, 2022

#828 in Command line utilities

Download history 1228/week @ 2024-07-28 2090/week @ 2024-08-04 1074/week @ 2024-08-11 1028/week @ 2024-08-18 716/week @ 2024-08-25 1092/week @ 2024-09-01 316/week @ 2024-09-08 328/week @ 2024-09-15 380/week @ 2024-09-22 450/week @ 2024-09-29 384/week @ 2024-10-06 611/week @ 2024-10-13 85/week @ 2024-10-20 54/week @ 2024-10-27 26/week @ 2024-11-03 16/week @ 2024-11-10

190 downloads per month
Used in 4 crates (via yash-semantics)

MIT/Apache

99KB
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.

yash-fnmatch at crates.io yash-fnmatch at docs.rs Build status

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

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.5–4MB
~72K SLoC