On this page:
glob->matcher
glob-match?

4.2 Glob Matching🔗ℹ

The zuo/glob module is reprovided by zuo.

procedure

(glob->matcher glob)  (string? . -> . boolean?)

  glob : string?
Creates a procedure that takes a string and reports #t if the string matches the pattern glob, #f otherwise.

The pattern language of glob is based on shell globbing:

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?
Equivalent to ((glob->matcher glob) str).