python 正则笔记
G8bao7
2015-06-12 11:18:49
IT综合
原创
# 将变量b中"连续的空格"替换为"一个空格"
re.sub("\s+", " ", b)
#
整词替换
# old/new里若带括号则失败
re.sub(r"\b%s\b" % (old), new, src)
收藏
linux time 命令详解