MCPcopy
hub / github.com/Jack-Lee-Hiter/AlgorithmsByPython / add

Function add

regularExpression/re模块其他方法.py:28–31  ·  view source on GitHub ↗
(match)

Source from the content-addressed store, hash-verified

26
27# 利用函数将str3中的数字加1
28def add(match):
29 val = match.group()
30 num = int(val) + 1
31 return str(num)
32
33info = re.sub(r'\d+', add, str3)
34print(info)

Callers

nothing calls this directly

Calls 1

groupMethod · 0.80

Tested by

no test coverage detected