>>> import re
>>> m = 'level="Information" clientAddr="127.0.0.1" action="GetByName" message="Action completed" url="/customers/foo" method="GET"'
>>> s = re.findall(r'"([^"]*)"', m)
>>> for i in s:
... print i
...
Information
127.0.0.1
GetByName
Action completed
/customers/foo
GET
通过findall函数,可以得到双引号中的值。你知道吗
相关问题 更多 >
编程相关推荐