当前位置: 代码迷 >> ASP >> 请教这个正则如何写
  详细解决方案

请教这个正则如何写

热度:177   发布时间:2013-09-28 10:01:20.0
请问这个正则怎么写?
字符串为:<table class="result" id="11"

我是asp程序,我想把11这个数字取出来我的写法如下:
Dim regEx, Match, Matches   ' 建立变量。
patrn="<table class=""result"" id="".*"""
Set regEx = New RegExp   ' 建立正则表达式。
regEx.Pattern = patrn   ' 设置模式。
regEx.IgnoreCase = True   ' 设置是否区分大小写。
regEx.Global = True   ' 设置全局替换。
Set Matches = regEx.Execute(wstr)   ' 执行搜索。
For Each Match in Matches   ' 遍历 Matches 集合。
ReStr=Match.Value
response.Write(restr & "<br>")
next

为什么11会取不到,不知道我的正则错在哪里?

------解决方案--------------------
patrn="<table class=""result"" id=""(.*?)"""

patrn="<table class=""result"" id=""(\d+?)"""
  相关解决方案