首页 /编程语言和算法/VB6/VBA/ASP
 VBA代码 正则匹配字符串
2025年3月18日 14:44
Function RegexMatchText(ByVal strTest As String, ByVal strRegExp As String)
    ' 本程序使用正则式对输入字符串进行匹配,若匹配' 成功,则返回TRUE,否则返回FALSE。
    On Error Resume Next
    Dim regex As Object
    Set regex = CreateObject("VBScript.RegExp")
    With regex
        .Global = True
        .Pattern = strRegExp
        regex_Test = .Test(strTest)
    End With
End Function



 
全部回复(0)
首页 | 电脑版 |