ASP正则匹配URL的正确性
2009-05-06 10:40:11 来源:WEB开发网核心提示:Function iswww(strng) iswww = false Dim regEx, Match Set regEx = New RegExp regEx.Pattern = "^(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\
Function iswww(strng)
iswww = false
Dim regEx, Match
Set regEx = New RegExp
regEx.Pattern = "^(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?$"
regEx.IgnoreCase = True
Set Match = regEx.Execute(strng)
if match.count then iswww= true
End Function
iswww = false
Dim regEx, Match
Set regEx = New RegExp
regEx.Pattern = "^(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?$"
regEx.IgnoreCase = True
Set Match = regEx.Execute(strng)
if match.count then iswww= true
End Function
[]
更多精彩
赞助商链接