【发布时间】:2014-05-05 16:12:46
【问题描述】:
这是python中的简单字符串操作:
string = '<longitude>-170.794865296</longitude>'
如何提取-170.794865296?
寻找简单易行的方法。
【问题讨论】:
-
这是 xml 文件的一部分吗?你是怎么得到字符串的?
-
docs.python.org/2/library/re.html 正则表达式应该可以解决问题。
-
这是我的字符串列表中的一个元素
标签: python xml parsing xml-parsing