發表文章

目前顯示的是 3月, 2013的文章

正規表示式整理表

正規表示式的特定字元 說明 等效的正規表示式 \d 數字 [0-9] \D 非數字 [^0-9] \w 數字、字母、底線 [a-zA-Z0-9_] \W 非  \w [^a-zA-Z0-9_] \s 空白字元 [ \r\t\n\f] \S 非空白字元 [^ \r\t\n\f]

網址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