正则提取请教
代码<SPAN id=ext-gen1127 class=member>系统消息说:</SPAN>
<SPAN id=ext-gen1128 class=time>2014-03-30 22:02:08</SPAN><DIV id=ext-gen1121 class=message-body>主动推送</DIV>
<SPAN class=member>系统消息说:</SPAN><SPAN class=time>2014-03-30 22:02:34</SPAN><DIV id=ext-gen1120 class=message-body>提供信息
SPAN class=member>系统消息说:</SPAN><SPAN class=time>2014-03-30 22:19:00</SPAN>
<DIV id=ext-gen1138 class=message-body>会话结束</DIV>
请问怎么提取最后一个时间2014-03-30 22:19:00,用正则
<SPAN class=member>系统消息说:</SPAN><SPAN class=time>(.*?)</SPAN>[\s\S]+会话结束
只能抓到第一个时间2014-03-30 22:02:34,抓取不到最后一个时间,求教 ([\d\h:-]+)<.+\v+.+?会话结束 回复 2# afan
神了,牛 回复 2# afan
A版真是正则帝!现学现卖一个e>(.*?)</SPAN>\v*.*?会话结束 玩玩~$Str = _
'<SPAN id=ext-gen1127 class=member>系统消息说:</SPAN>' & @CRLF & _
'<SPAN id=ext-gen1128 class=time>2014-03-30 22:02:08</SPAN><DIV id=ext-gen1121 class=message-body>主动推送</DIV>' & @CRLF & _
'<SPAN class=member>系统消息说:</SPAN><SPAN class=time>2014-03-30 22:02:34</SPAN><DIV id=ext-gen1120 class=message-body>提供信息' & @CRLF & _
'SPAN class=member>系统消息说:</SPAN><SPAN class=time>2014-03-30 22:19:00</SPAN>' & @CRLF & _
'<DIV id=ext-gen1138 class=message-body>会话结束</DIV>'
Local $Test = StringRegExpReplace($Str, '(?s).+(\d{4}-\d{2}-\d{2}\h\d{2}:\d{2}:\d{2}).*', '\1')
MsgBox(0, 0, $Test)
页:
[1]