afan这个是相反了,数据去掉了。。。留下很多标签,数据不见鸟
huangke 发表于 2013-1-22 21:54
适用例子#include <Array.au3>
Local $Str = _
'<DIV id=content class=content mod-cs-content text-content clearfix>' & @CRLF & _
'<P><SPAN>2013/01/30</SPAN></P>' & @CRLF & _
'<P><SPAN><SPAN>2013/05/30</SPAN><BR></SPAN></P>' & @CRLF & _
'<P><SPAN><SPAN><SPAN>2013/12/30</SPAN><BR></SPAN></SPAN></P>' & @CRLF & _
'<P><SPAN><SPAN><SPAN><SPAN>2014/01/01</SPAN><BR></SPAN></SPAN></SPAN></P>' & @CRLF & _
'<P><SPAN><SPAN><SPAN><SPAN><SPAN>2013/06/01</SPAN><BR></SPAN></SPAN></SPAN></SPAN></P>' & @CRLF & _
'<P><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN>2014/01/01</SPAN></SPAN><BR></SPAN></SPAN></SPAN></SPAN></SPAN></P>' & @CRLF & _
'<P><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN>2014/06/01</SPAN><BR></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></P>' & @CRLF & _
'<P><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN>2014/12/01</SPAN><BR></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></P>' & @CRLF & _
'<P><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN>2015/01/01</SPAN><BR></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></P>' & @CRLF & _
'<P><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN>2015/06/01</SPAN></SPAN><BR></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></P>' & @CRLF & _
'<P><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN>2015/12/01</SPAN></SPAN><BR></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></P>' & @CRLF & _
'<P><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN>2016/01/01</SPAN><BR></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></P>' & @CRLF & _
'<P><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN>1</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></P>' & @CRLF & _
'<P><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN>2</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></P>' & @CRLF & _
'<P><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN>3</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></P>' & @CRLF & _
'<P><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN>4</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></P>' & @CRLF & _
'<P><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN>5</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></P>' & @CRLF & _
'<P><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN>6</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></P>' & @CRLF & _
'<P><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN>7</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></P>' & @CRLF & _
'<P><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN>8</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></P>' & @CRLF & _
'<P><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN>9</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></P>' & @CRLF & _
'<P><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN><SPAN>10</SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></SPAN></P></DIV>' & @CRLF & _
'<DIV class=mod-tagbox clearfix>'
Local $Test = StringRegExp($str, '(?i)SPAN>([\d\/]+)', 3)
If @Error Then Exit
_ArrayDisplay($Test, '列表需要')
Local $Test1 = StringRegExpReplace($str, '<.*?>', '')
MsgBox(0, '整体需要', $Test1)
|