我有来自服务器的以下日志文件,我想从以下字符串中提取 xml。
2:00:11 PM >>Response: <?xml version="1.0" encoding="UTF-8"?>
<HotelML xmlns="http://www.xpegs.com/v2001Q3/HotelML"><Head><Route Destination="TR" Source="00"><Operation Action="Create" App="UltraDirect-d1c1_" AppVer="V1_1" DataPath="/HotelML" StartTime="2013-07-31T08:33:13.223+00:00" Success="true" TotalProcessTime="711"/></Route>............
</HotelML>
3:00:11 PM >>Response: <?xml version="1.0" encoding="UTF-8"?>
<HotelML xmlns="http://www.xpegs.com/v2001Q3/HotelML"><Head><Route Destination="TR" Source="00"><Operation Action="Create" App="UltraDirect-d1c1_" AppVer="V1_1" DataPath="/HotelML" StartTime="2013-07-31T08:33:13.223+00:00" Success="true" TotalProcessTime="711"/></Route>............
</HotelML>
5:00:11 PM >>Response: <?xml version="1.0" encoding="UTF-8"?>
<HotelML xmlns="http://www.xpegs.com/v2001Q3/HotelML"><Head><Route Destination="TR" Source="00"><Operation Action="Create" App="UltraDirect-d1c1_" AppVer="V1_1" DataPath="/HotelML" StartTime="2013-07-31T08:33:13.223+00:00" Success="true" TotalProcessTime="711"/></Route>............
</HotelML>
我已经为相同的内容编写了以下正则表达式,但它仅匹配字符串中的第一个条目。但我想将所有 xml 字符串作为集合返回。
(?<= Response:).*>.*</.*?>