Package conary :: Package lib :: Module fixedfnmatch
[hide private]
[frames] | no frames]

Module fixedfnmatch

source code

Filename matching with shell patterns.

Functions [hide private]
 
fnmatch(name, pat)
Test whether FILENAME matches PATTERN.
source code
 
filter(names, pat)
Return the subset of the list NAMES that match PAT
source code
 
fnmatchcase(name, pat)
Test whether FILENAME matches PATTERN, including case.
source code
 
translate(pat)
Translate a shell PATTERN to a regular expression.
source code
Variables [hide private]
  _cache = {}
Function Details [hide private]

fnmatch(name, pat)

source code 

Test whether FILENAME matches PATTERN.

Patterns are Unix shell style:

* matches everything ? matches any single character [seq] matches any character in seq [!seq] matches any char not in seq

An initial period in FILENAME is not special. Both FILENAME and PATTERN are first case-normalized if the operating system requires it. If you don't want this, use fnmatchcase(FILENAME, PATTERN).

fnmatchcase(name, pat)

source code 

Test whether FILENAME matches PATTERN, including case.

This is a version of fnmatch() which doesn't case-normalize its arguments.

translate(pat)

source code 

Translate a shell PATTERN to a regular expression.

There is no way to quote meta-characters.