我有这样一根线:
string ='ArcelorMittal invests =E2=82=AC87m in new process that cuts emissions=20'
我想拿出=E2=82=AC
和=20
但当我使用
pattern ='(=\w\w)+'
a=re.split(pattern,string)
它回来了
['ArcelorMittal invests ', '=AC', '87m in new process that cuts emissions', '=20', '']
Tags:
基于your comment,我建议您对原始字符串使用^{} 。不需要提取这些字符并分别解码
你可以用
re.findall
如果要删除这些字符,请使用
re.sub
。你知道吗相关问题 更多 >
编程相关推荐