这段文本
In [6]: re.findall("<!--.*-->",aa,re.S|re.M) #这样匹配的到
Out[6]: ['<!--\ngoogle_ad_client = "pub-7133395778201029";\ngoogle_ad_width = 468;\ngoogle_ad_height = 60;\ngoogle_ad_format = "468x60_as";\ngoogle_ad_type = "image";\ngoogle_ad_channel = "";\n//-->']
In [8]: re.sub("<!--.*-->","",aa,re.S|re.M) #这样替换不掉呢
Out[8]: '<!--\ngoogle_ad_client = "pub-7133395778201029";\ngoogle_ad_width = 468;\ngoogle_ad_height = 60;\ngoogle_ad_format = "468x60_as";\ngoogle_ad_type = "image";\ngoogle_ad_channel = "";\n//-->'
一直是这么写的没毛病 啊 为啥这次不行了呢