Skip to main content

Module glob

Module glob 

Source
Expand description

Shell glob matching: PHP’s fnmatch().

PHP calls the C library’s fnmatch(3). The runtimes this port is held to run on Alpine Linux, so this is musl’s implementation (src/regex/fnmatch.c) in the C.UTF-8 locale PHP runs in there: characters are UTF-8 sequences, character classes are musl’s Unicode tables ([classes]), an invalid sequence in the pattern matches nothing and one in the name only matches ? or a negated bracket, as musl reads them.

PHPRust
fnmatch($pattern, $filename) (no flags)fnmatch

Functions§

fnmatch
PHP fnmatch($pattern, $filename): whether filename matches the shell glob pattern (*, ?, [...] with !/^, ranges and [:class:], \ escapes; * crosses / and a leading . is not special).