This is the Tcl-style glob matcher from Redis and Jim by Salvatore Sanfilippo, aka antirez, extracted as a library.
It first appeared in Jim, a Tcl
interpreter, as an implementation of the string match
Tcl function. It was
then reused
in other projects by antirez, in a succession from Visitors
to Strabo, Redis,
then Disque. The function has evolved
separately in Redis to fix security issues and in Jim to add features like UTF-8
support. Forks of Redis, Valkey and
KeyDB, have not changed it. The relevant
subsets of each project's revision history are tracked in separate Git branches.
Of particular note, it was vulnerable to a denial-of-service from pathological patterns that caused exponential time complexity, until it was reported in CVE-2022-36021 (and earlier on Hacker News) and fixed in Redis in dcbfcb916 (String pattern matching had exponential time complexity on pathological patterns (CVE-2022-36021) (#11858), 2023-02-28).
stringmatch is made available under the BSD-3-Clause license, just as Redis was before changing to dual (non-free) RSALv2 and SSPLv1 licenses. Versions with lineage from other projects may be under different licenses.