re.sub()

re.sub(pattern, repl, string, count=0, flags=0)

参数:

    • pattern : 正则中的模式字符串。
    • repl : 替换后的字符串,也可为一个函数。
    • string : 要被查找替换的原始字符串。
    • count : 模式匹配后替换的最大次数,默认 0 表示替换所有的匹配。

 

posted @ 2021-04-22 09:44  柒久酒  阅读(90)  评论(0编辑  收藏  举报