We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb01d53 commit 9a8e7fdCopy full SHA for 9a8e7fd
src/utils/str.py
@@ -307,9 +307,9 @@ def perlReToReplacer(s):
307
flags = ''.join(flags)
308
r = perlReToPythonRe(sep.join(('', regexp, flags)))
309
if g:
310
- return lambda s: r.sub(replace, s)
+ return functools.partial(r.sub, replace)
311
else:
312
- return lambda s: r.sub(replace, s, 1)
+ return functools.partial(r.sub, replace, count=1)
313
314
_perlVarSubstituteRe = re.compile(r'\$\{([^}]+)\}|\$([a-zA-Z][a-zA-Z0-9]*)')
315
def perlVariableSubstitute(vars, text):
0 commit comments