主题:正则表达式的问题
下面这个字段:
<td colspan="3" class="font_red"><strong>05月16日20时至05月17日20时</strong></td>
我想要通过正则表达式把中间的日期部分取出来
现在的代码:
Dim regEx,Match,Matches
Set regEx = New RegExp
regEx.Pattern = "<td colspan=""3"" class=""font_red""><strong>([^<]+)"
regEx.IgnoreCase = True
regEx.Global = True
Set Matches = regEx.Execute(html)
For Each Match in Matches
riqi=Match.Value
Next
set regEx = nothing
但是执行后,
riqi="<td colspan="3" class="font_red"><strong>05月16日20时至05月17日20时"
前面不是我想要的,我想问一下怎么才能只留下日期呢?
<td colspan="3" class="font_red"><strong>05月16日20时至05月17日20时</strong></td>
我想要通过正则表达式把中间的日期部分取出来
现在的代码:
Dim regEx,Match,Matches
Set regEx = New RegExp
regEx.Pattern = "<td colspan=""3"" class=""font_red""><strong>([^<]+)"
regEx.IgnoreCase = True
regEx.Global = True
Set Matches = regEx.Execute(html)
For Each Match in Matches
riqi=Match.Value
Next
set regEx = nothing
但是执行后,
riqi="<td colspan="3" class="font_red"><strong>05月16日20时至05月17日20时"
前面不是我想要的,我想问一下怎么才能只留下日期呢?