Lines Matching +full:- +full:- +full:match +full:- +full:filename
1 """Filename matching with shell patterns.
3 fnmatch(FILENAME, PATTERN) matches according to the local convention.
4 fnmatchcase(FILENAME, PATTERN) always takes case in account.
20 """Test whether FILENAME matches PATTERN.
29 An initial period in FILENAME is not special.
30 Both FILENAME and PATTERN are first case-normalized
32 If you don't want this, use fnmatchcase(FILENAME, PATTERN).
41 pat_str = str(pat, 'ISO-8859-1')
43 res = bytes(res_str, 'ISO-8859-1')
46 return re.compile(res).match
49 """Construct a list from those elements of the iterable NAMES that match PAT."""
52 match = _compile_pattern(pat)
56 if match(name):
60 if match(os.path.normcase(name)):
65 """Test whether FILENAME matches PATTERN, including case.
67 This is a version of fnmatch() which doesn't case-normalize
70 match = _compile_pattern(pat)
71 return match(name) is not None
77 There is no way to quote meta-characters.
94 if (not res) or res[-1] is not STAR:
110 if '-' not in stuff:
116 k = pat.find('-', k, j)
126 chunks[-1] += '-'
127 # Remove empty ranges -- invalid in RE.
128 for k in range(len(chunks)-1, 0, -1):
129 if chunks[k-1][-1] > chunks[k][0]:
130 chunks[k-1] = chunks[k-1][:-1] + chunks[k][1:]
132 # Escape backslashes and hyphens for set difference (--).
134 stuff = '-'.join(s.replace('\\', r'\\').replace('-', r'\-')
140 # Empty range: never match.
143 # Negated empty range: match any character.
168 # .*? match followed by `fixed`, with no possibility of backtracking.