我有这样一句话:
<bpt i="1" type="1" x="1" />und ZF-Getriebe <ept i="1" />TipMatic <ph x="2" type="2" />Lite (</cf>6AS850, 6AS800, 6AS1000)
我想要一个正则表达式,它将提取xml部分,因此最后的句子将是:
__xml__und ZF-Getriebe __xml__TipMatic __xml__Lite (</cf>6AS850, 6AS800, 6AS1000)
可能的正则表达式是什么
Tags:
我不认为有什么好的方法可以做到这一点——好吧,正则表达式在提取XML方面不是很好。您最好的选择可能是使用BeautifulSoup:
您也可以通过以下方式浏览列表
您可以检查每个子项的类型,看看它是字符串还是XML
假设xml标记总是打开-关闭的,这可能会满足您的需要。您仍需要将xml放入
相关问题 更多 >
编程相关推荐