fnmatch(string pattern, string filename) checks if filename matches pattern. pattern may contain *, ? or bracket expressions enclosed in and . A backslash can be used to escape one of the special characters. The match is case sensitive.
fnmatch(string, string, list(enum)) takes a list of additional flags the allow to customize the behaviour of fnmatch. The available flags are: `period: If the filename begins with a period (known as hidden file) then the pattern also must begin with a period in order to match (this is the way the shell behaves). `noescape: The backslash is not considered to be an escape character. `pathname The path separater / is not matched by *, ? or ... but must occur explicitely in the pattern. `casefold: the match is done case insensitive.
fnmatch("hello.txt", "*.txt") == true
fnmatch("hello.c", "hello.[ch]") == true
fnmatch("/tmp/test", "*") == true
fnmatch(".bashrc", "*", [ `period ]) == false
fnmatch(".bashrc", ".*", [ `period ]) == true
fnmatch("/tmp/test", "*", [ `pathname ]) == false
fnmatch("/tmp/test", "/*/*", [ `pathname ]) == true
