Home | History | Annotate | Download | only in python2.7

Lines Matching refs:pat

24 def fnmatch(name, pat):
42 pat = os.path.normcase(pat)
43 return fnmatchcase(name, pat)
45 def filter(names, pat):
46 """Return the subset of the list NAMES that match PAT"""
49 pat=os.path.normcase(pat)
50 if not pat in _cache:
51 res = translate(pat)
54 _cache[pat] = re.compile(res)
55 match=_cache[pat].match
67 def fnmatchcase(name, pat):
74 if not pat in _cache:
75 res = translate(pat)
78 _cache[pat] = re.compile(res)
79 return _cache[pat].match(name) is not None
81 def translate(pat):
87 i, n = 0, len(pat)
90 c = pat[i]
98 if j < n and pat[j] == '!':
100 if j < n and pat[j] == ']':
102 while j < n and pat[j] != ']':
107 stuff = pat[i:j].replace('\\','\\\\')