4.2 Glob Matching
procedure
(glob->matcher glob) → (string? . -> . boolean?)
glob : string?
The pattern language of glob is based on shell globbing:
? matches any character;
* matches any squence of characters; and
[range] matches any character in range, and [^range] matches any character not in range.
In a range, most characters stand for themselves as elements of the range, including * and ?, including ] when it appears first, and including - when it appears first or last. When - appears between two characters in range, then the second character’s value must be at least as large as the first, and all character in from the first (inclusive) to the second (inclusive) are included in the range.
A leading . or a / in an input string are not treated specially. That is, "*" matches ".apple" and "a/pple" as well as "apple". Use split-path and a secondary check for a leading . to imitate shell-like path-sensitive globbing.
procedure
(glob-match? glob str) → boolean?
glob : string? str : string?