MCPcopy Index your code
hub / github.com/borgbackup/borg / RegexPattern

Class RegexPattern

src/borg/patterns.py:288–299  ·  view source on GitHub ↗

Regular expression to exclude.

Source from the content-addressed store, hash-verified

286
287
288class RegexPattern(PatternBase):
289 """Regular expression to exclude."""
290
291 PREFIX = "re"
292
293 def _prepare(self, pattern):
294 self.pattern = pattern # / at beginning is NOT removed
295 self.regex = re.compile(pattern)
296
297 def _match(self, path):
298 assert "\\" not in path
299 return self.regex.search(path) is not None
300
301
302_PATTERN_CLASSES = {FnmatchPattern, PathFullPattern, PathPrefixPattern, RegexPattern, ShellPattern}

Callers 4

test_patterns_regexFunction · 0.85
test_regex_patternFunction · 0.85
_make_test_patternsFunction · 0.85
test_pattern_matcherFunction · 0.85

Calls

no outgoing calls

Tested by 4

test_patterns_regexFunction · 0.68
test_regex_patternFunction · 0.68
_make_test_patternsFunction · 0.68
test_pattern_matcherFunction · 0.68