A glob crate like this one? https://github.com/mozilla/rust/blob/master/src/libglob/lib.rs
Steven Fackler On Mon, May 26, 2014 at 6:57 PM, Daniel Fagnan <[email protected]> wrote: > Writing it here to gauge an interest of the community for a glob crate. If > it seems people are liking the idea, I'll write an RFC for it and send a PR. > > I'm guessing the majority of the folks here already know what it is, as > it's pretty universal and used heavily in unix-based environments. > > (One *could* use a simple regex, but the interface wouldn't be the most > ideal) > > Something like: > > ```rust > use glob::Glob; > > fn main() { > let fn globber = Glob::new(r"foo/**/*.rs"); > > let list = vec!["foo/hello.rs", "foo/foo2/woot.rs"]; > > match globber.match(list.get(0)) { > // ... > } > > // Or you could match all and you would get a Result<Vec<String>> where > // the contents of the vector are only the matched occurrences. > globber.match_all(list); > } > ``` > > Thoughts? > > -- > Daniel Fagnan > Titan Analytics Inc. > www.titananalytics.com > M: (780) 983-4997 > > _______________________________________________ > Rust-dev mailing list > [email protected] > https://mail.mozilla.org/listinfo/rust-dev > >
_______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
