網址url 正規表示式


"(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?"


 Public Shared Function RegURL(ByVal strParam As String) As Boolean
        Dim r As Regex = New Regex("(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?")
        Dim m As Match = r.Match(strParam)
        If m.Success And m.Length = Len(strParam) Then
            Return True
        Else
            Return False
        End If
    End Function

留言

這個網誌中的熱門文章

[Windows]密碼複雜性需求 停用密碼複雜度

net use 系統發生 1219 錯誤