match_glob
Whether text matches a simple glob pattern in full: * matches any sequence of characters
(including none), ? exactly one character, everything else is literal.
It is not a shell glob: no [...] classes, {a,b} alternatives, escapes or path-aware **,
just the two wildcards. Characters are Unicode scalar values (char), so ? matches a whole
é or emoji. Matching is case-sensitive; lowercase both sides to ignore case. Runs in
O(pattern × text) at worst, without recursion or a regex engine.
Import
Section titled “Import”Cargo feature string (enabled by default). To compile only this module:
or in Cargo.toml:
Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
pattern | &str | The glob pattern. |
text | &str | The string to test. |
Returns
Section titled “Returns”bool — true if text matches pattern.
