日期:2014-05-18  浏览次数:20772 次

求以正则
字符串如下:
<?xml version="1.0" encoding="UTF-8"?>
<volist>
<vo>
<field name="cwarehouseid" value="1001Ware000000000010" type="S" />
<field name="pk_corp" value="1001" type="S" />
</vo>
</volist>
#####===#####
<?xml version="1.0" encoding="UTF-8"?>
<volist>
<vo>
<field name="user_code" value="1" type="S" />
<field name="cuserid" value="" type="S" />
<field name="user_password" value="1" type="S" />
</vo>
</volist>
要获得其中的两个xml文件

------解决方案--------------------
建立一个3.txt,内容是测试数据
HTML code

<?xml version="1.0" encoding="UTF-8"?>
<volist>
<vo>
<field name="cwarehouseid" value="1001Ware000000000010" type="S" />
<field name="pk_corp" value="1001" type="S" />
</vo>
</volist>
#####===#####
<?xml version="1.0" encoding="UTF-8"?>
<volist>
<vo>
<field name="user_code" value="1" type="S" />
<field name="cuserid" value="" type="S" />
<field name="user_password" value="1" type="S" />
</vo>
</volist>

------解决方案--------------------
(?is)<\?xml\b.*?</volist>