正则匹配指定字符开头指定字符结尾中间部分的数字

Sub tes()
    Strs = "AO 22m IVSd  7mm LVDd 43mm RV 18mm"
    Set reg = CreateObject("vbscript.regexp")
    With reg
        .Global = False
        .ignorecase = True
        .Pattern = "IVSd\s+(\d{1,2}?)mm"
        '    Set mh = .Execute(Strs)
        res = .Execute(Strs)(0).submatches(0)
    End With
End Sub

 

posted @ 2022-11-21 09:34  依云科技  阅读(350)  评论(0)    收藏  举报