我有一个带有一列文本的pandas数据框,我想从那里删除html颜色代码,这是文本的示例:
{color:#000000}So today while lurking around with the processing, I have stumbled across the main reason why it takes 15 minutes. {color}{color:#000000} {color}{color:#000000}It is because our trigger tooks 15 minutes to finishing sending the signal!{color}{color:#000000} {color}{color:#000000}
我想要的输出没有那些十六进制的颜色
So today while lurking around with the processing, I have stumbled across the main reason why it takes 15 minutes.It is because our trigger tooks 15 minutes to finishing sending the signal
尝试:
re.sub(r'\{color.*?\}', '', st)
st = "{color:#000000}So today while lurking around with the processing, I have stumbled across the main reason why it takes 15 minutes. {color}{color:#000000} {color}{color:#000000}It is because our trigger tooks 15 minutes to finishing sending the signal!{color}{color:#000000} {color}{color:#000000}"
re.sub(r'\{color.*?\}', '', st)
输出:
'So today while lurking around with the processing, I have stumbled across the main reason why it takes 15 minutes. It is because our trigger tooks 15 minutes to finishing sending the signal! '