字符串替换
# coding=utf8 import re p = re.compile("world") s = "hello world, i love world, thx world." b = p.sub("python", s) print b ''' 输出: hello python, i love python, thx python. '''
新的博客地址请访问:https://blog.imekaku.com/
# coding=utf8 import re p = re.compile("world") s = "hello world, i love world, thx world." b = p.sub("python", s) print b ''' 输出: hello python, i love python, thx python. '''
开始在上面输入您的搜索词,然后按回车进行搜索。按ESC取消。