192
192
base_patterns.append(pat)
193
193
self._add_patterns(ext_patterns,_sub_extension,
194
194
prefix=r'(?:.*/)?(?!.*/)(?:.*\.)')
196
196
prefix=r'(?:.*/)?(?!.*/)')
199
199
def _add_patterns(self, patterns, translator, prefix=''):
201
201
grouped_rules = ['(%s)' % translator(pat) for pat in patterns[:99]]
202
202
joined_rule = '%s(?:%s)$' % (prefix, '|'.join(grouped_rules))
207
207
def match(self, filename):
208
208
"""Searches for a pattern that matches the given filename.
210
210
:return A matching pattern or None if there is no matching pattern.
212
212
for regex, patterns in self._regex_patterns: