fnmatch
Index
Types
type flag = enum uint {
NONE = 0,
PATHNAME = 1u << 0,
NOESCAPE = 1u << 1,
PERIOD = 1u << 2,
};
Functions
fn fnmatch(pattern: str, string: str, flags: flag = flag::NONE) bool;
Types
type flag
type flag = enum uint {
NONE = 0,
PATHNAME = 1u << 0,
NOESCAPE = 1u << 1,
PERIOD = 1u << 2,
};
A set of flags that alter the matching behavior of fnmatch
Functions
fn fnmatch
fn fnmatch(pattern: str, string: str, flags: flag = flag::NONE) bool;
Check whether the 'string' matches the 'pattern', which is a shell wildcard pattern with the following matching rules:
- '?' matches any single character
- '*' matches any string, including the empty string
- '[' and ']' enclose a bracket expression. Matching rules for bracket expressions are identical to those of bracket subexpressions in regular expressions, except that '!' takes the role of '^' when placed right after the opening '['.
- '\' escapes the following character, e. g. "\*" only matches literal '*' and has no special meaning
- all other characters only match themselves
A set of flags that alter the matching behavior may be passed to fnmatch. For an explanation of their meaning, see flag.