asp 정규 표현 식 은 숫자$숫자$숫자$와 일치 합 니 다.

1148 단어 asp정규 표현 식

Dim strOk,strNo 
    strOk = "12312321$12312312312$12312321$" 
    strNo = "12312321$12312312312$12312321$sdfsd" 

    Function RegExpTest(patrn, strng) 
        Dim regEx, match, matches   '  。 
        Set regEx = New RegExp   '  。 
        regEx.Pattern = patrn   '  。 
        regEx.IgnoreCase = True   '  。 
        regEx.Global = false   '  。 
        set matches= regEx.Execute(strng)   '  。 
        for each match in matches      '   
            RetStr=RetStr &"Match found at position " 
            RetStr=RetStr&Match.FirstIndex&".Match Value is '" 
            RetStr=RetStr&Match.Value&"'."&vbCRLF 
        Next 
        IF Not IsEmpty(matches) And matches(0).Value = strng Then 
            RegExpTest = true 
        Else  
            RegExpTest = false 
        End IF 
    End Function 
    MsgBox(RegExpTest("[\d+\$]+", strOk))

좋은 웹페이지 즐겨찾기