Name

ap_fnmatch — match a filename

Synopsis

int ap_fnmatch(const char *pattern, const char *string, int flags)

Matches string against pattern, returning 0 for a match and FNM_NOMATCH otherwise. pattern consists of the following:

?

Match a single character.

*

Match any number of characters.

[...]

Represents a closure, as in regular expressions. A leading caret (^) inverts the closure.

\

If FNM_NOESCAPE is not set, removes any special meaning from next character.

flags is a combination of the following:

FNM_NOESCAPE

Treat a "\" as a normal character.

FNM_PATHNAME

*, ?, and [...] don’t match "/.”.

FNM_PERIOD

*, ?, and [...] don’t match leading dots. “Leading” means either at the beginning of the string or after a "/" if FNM_PATHNAME is set.