MCPcopy Index your code
hub / github.com/python/cpython / replace

Method replace

Lib/zipfile/_path/glob.py:66–75  ·  view source on GitHub ↗

Perform the replacements for a match from :func:`separate`.

(self, match)

Source from the content-addressed store, hash-verified

64 return ''.join(map(self.replace, separate(self.star_not_empty(pattern))))
65
66 def replace(self, match):
67 """
68 Perform the replacements for a match from :func:`separate`.
69 """
70 return match.group('set') or (
71 re.escape(match.group(0))
72 .replace('\\*\\*', r'.*')
73 .replace('\\*', rf'[^{re.escape(self.seps)}]*')
74 .replace('\\?', r'[^/]')
75 )
76
77 def restrict_rglob(self, pattern):
78 """

Callers 4

_sanitize_filenameFunction · 0.45
_extract_memberMethod · 0.45
fromutcMethod · 0.45
available_timezonesFunction · 0.45

Calls 2

escapeMethod · 0.80
groupMethod · 0.45

Tested by

no test coverage detected