我有一个xml字符串
Traceback (most recent call last):
File "exploitsearch.py", line 26, in <module>
print exploit.search('query')
File "/usr/local/lib/python2.7/dist-packages/shodan/client.py", line 79, in search
return self.parent._request('/api/search', query_args, service='exploits')
AttributeError: 'str' object has no attribute '_request'
我希望使用正则表达式来提取客户端标记和存储在变量中的内容。目前我有
<client>12345abcde</client>
但这似乎不起作用。
答案 0 :(得分:0)
Matcher m = Pattern.compile(".*<client>(.*)<\\/client>.*").matcher("<client>12345abcde</client>");
m.matches();
String value = m.group(2);