fnmatch+x86_64 +linux

The fnmatch module provides an implementation of fnmatch string matching as defined by POSIX.

https://pubs.opengroup.org/onlinepubs/9699919799/functions/fnmatch.html

Index

Types

type flag = enum uint {
	NONE = 0,
	// If this flag is set, slashes in the string will only be matched by
	// literal slashes in the pattern
	PATHNAME = 1u << 0,
	// If this flag is set, backslash will be treated as an ordinary
	// character
	NOESCAPE = 1u << 1,
	// If this flag is set, a '.' at the beginning of the string can only
	// be matched by a literal '.' in the pattern. If [[flag::PATHNAME]] is
	// set simultaneously, this behavior also apply to any periods
	// immediately following a slash.
	PERIOD = 1u << 2,
};

Functions

fn fnmatch(pattern: str, string: str, flags: flag = flag::NONE) bool;

Types

type flag[link]

type flag = enum uint {
	NONE = 0,
	// If this flag is set, slashes in the string will only be matched by
	// literal slashes in the pattern
	PATHNAME = 1u << 0,
	// If this flag is set, backslash will be treated as an ordinary
	// character
	NOESCAPE = 1u << 1,
	// If this flag is set, a '.' at the beginning of the string can only
	// be matched by a literal '.' in the pattern. If [[flag::PATHNAME]] is
	// set simultaneously, this behavior also apply to any periods
	// immediately following a slash.
	PERIOD = 1u << 2,
};

A set of flags that alter the matching behavior of fnmatch

Functions

fn fnmatch[link]

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:

A set of flags that alter the matching behavior may be passed to fnmatch. For an explanation of their meaning, see flag.