プロジェクト
GitHubで見る
cloudflare/wildcard
cloudflare/wildcard has 220 GitHub stars and 8 forks. GitHot measured 0 stars in 24 hours and 0 in 7 days. Last checked 2026-11-24 05:28 UTC. Last push 2026-08-27.
計測したスター増加
- 24時間
- 0
- 7日間
- 0
- 15日間
- 履歴を収集中
- 1か月
- 履歴を収集中
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
概要
Wildcard matching
開発ツールREADME.md
オリジナルwildcard
wildcard is a rust crate for wildcard matching.
Here's how to use it:
let wildcard = Wildcard::new("*foo?*bar".as_bytes()).unwrap();
assert!(wildcard.is_match("fooofooobar".as_bytes()));
Special characters can be escaped to represent their literal symbol:
let wildcard = Wildcard::new(r"\*\?".as_bytes()).unwrap();
assert!(!wildcard.is_match("ab".as_bytes()));
assert!(wildcard.is_match("*?".as_bytes()));
You can also capture the substring that matched the metasymbols of the wildcard:
let wildcard = Wildcard::new("* is a * style?".as_bytes()).unwrap();
let captures: Vec<&[u8]> = wildcard.captures("Lambic is a beer style!".as_bytes()).unwrap();
assert_eq!(captures, ["Lambic".as_bytes(), "beer".as_bytes(), "!".as_bytes()]);
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().collect::<Vec<_>>();
let wildcard = Wildcard::new(&p).unwrap();
assert!(wildcard.is_match(&"fooofooobar".chars().collect::<Vec<_>>()));
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.
関連プロジェクトを探す
読み込み中…