yash-fnmatch

Crates.ioyash-fnmatch
lib.rsyash-fnmatch
version1.1.1
sourcesrc
created_at2022-07-02 04:09:38.117169
updated_at2024-04-09 15:18:50.96103
descriptionPOSIX-compatible pattern matching for globbing
homepage
repositoryhttps://github.com/magicant/yash-rs
max_upload_size
id617634
size112,708
WATANABE Yuki (magicant)

documentation

README

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.

Commit count: 2935

cargo fmt