wildcard
wildcard is a rust crate for wildcard matching.
Here's how to use it:
let wildcard = new.unwrap;
assert!;
Special characters can be escaped to represent their literal symbol:
let wildcard = new.unwrap;
assert!;
assert!;
You can also capture the substring that matched the metasymbols of the wildcard:
let wildcard = new.unwrap;
let captures: = wildcard.captures.unwrap;
assert_eq!;
String matching
For performance reasons wildcard does not match directly on strings, but it supports matching
on slices of chars:
let p = "*foo?*bar".chars.;
let wildcard = new.unwrap;
assert!;
Matching customization
With wildcard you can configure these properties of a wildcard:
- Configure the symbols for the metasymbols
*and?as well as the escape symbol. - Support for the metasymbol
?can be disabled. - Support for escaping can be disabled.
- Support for case-insensitive matching.