Skip to main content

glob_match

Function glob_match 

Source
pub fn glob_match(pattern: &str, input: &str) -> bool
Expand description

Simple glob matching โ€” supports *, ?, [abc].

Used by validate(glob("*.csv")). Does not use the regex crate.

ยงExamples

assert!(cli_ui::glob_match("*.csv", "data.csv"));
assert!(cli_ui::glob_match("file_?.txt", "file_1.txt"));
assert!(!cli_ui::glob_match("*.json", "data.csv"));