+ -
当前位置:首页 → 问答吧 → 正则问题

正则问题

时间:2011-07-27

来源:互联网

VBScript code
Function ReplaceTest(str,patrn) 
    Dim objRegExp, Match, Matches,temp
    Set objRegExp = New Regexp
    objRegExp.IgnoreCase = True
    objRegExp.Global = True
    objRegExp.Pattern = patrn
    Set Matches = objRegExp.Execute(strHTML)
    For Each Match in Matches
        temp = Match.Value
    Next
    Set objRegExp = Nothing
    ReplaceTest = str
End Function 


ReplaceTest(Html,"{news,(.*?)}")

Match.Value 匹配全部数据
如何获取 (.*?) 里面的内容

作者: cooc123   发布时间: 2011-07-27

顶起来、、、、、、、、、、、、、

作者: cooc123   发布时间: 2011-07-28

VBScript code
Function ReplaceTest(str,patrn) 
    Dim objRegExp, Match, Matches,temp
    Set objRegExp = New Regexp
    objRegExp.IgnoreCase = True
    objRegExp.Global = True
    objRegExp.Pattern = patrn
    Set Matches = objRegExp.Execute(str)
    For Each Match in Matches
        temp = Match.SubMatches(0)
    Next
    Set objRegExp = Nothing
    ReplaceTest = temp
End Function 

作者: aspwebchh   发布时间: 2011-07-28