对不起,另一个python新手问题。我有一个字符串:
my_string = "<p>this is some \n fun</p>And this is \n some more fun!"
我想:
my_string = "<p>this is some fun</p>And this is \n some more fun!"
换句话说,只有当它出现在 html 标记内时,我如何才能摆脱它?
我有:
my_string = re.sub('<(.*?)>(.*?)\n(.*?)</(.*?)>', 'replace with what???', my_string)
这显然行不通,但我被困住了。