Add additional named groups for regular expressions

后端 未结 0 1404
夕颜
夕颜 2021-02-01 23:43

With re.sub you can use named groups to refer them in the replacement string:

import re
re.sub(r"(?P.*):(.*)",
       r"         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题