<%
function IsHaveBadWord(str, BadWordList)
Dim strPattern
strPattern = BadWordList & "+"
Dim oRegEx, oMatch
Set oRegEx = New RegExp
oRegEx.IgnoreCase = True
oRegEx.Global = True
oRegEx.Pattern = strPattern
Set oMatch = oRegEx.Execute(str)
If oMatch.Count Then
IsHaveBadWord = True
Else
IsHaveBadWord = False
End If
End function
function ReplaceBadWord(str, BadWordList)
Dim strPattern
strPattern = BadWordList & "+"
Dim oRegEx, oMatch
Set oRegEx = New RegExp
oRegEx.IgnoreCase = True
oRegEx.Global = True
oRegEx.Pattern = strPattern
ReplaceBadWord = oRegEx.Replace(str, "*")
Set oRegEx = Nothing
End function
response.Write("ASP萧月痕xiaoyuehen " & IsHaveBadWord("ASP萧月痕xiaoyuehen", "xiaoyuehen|萧月痕") & "<br>")
response.Write("ASP萧月痕xiaoyuehen " & ReplaceBadWord("ASP萧月痕xiaoyuehen", "xiaoyuehen|萧月痕") & "<br>")
function MatchNumList(str)
Dim strPattern
strPattern = "^[0-9]{1,}(,[0-9]+){0,}___FCKpd___0quot;
Dim oRegEx, oMatch
Set oRegEx = New RegExp
oRegEx.IgnoreCase = True
oRegEx.Global = True
oRegEx.Pattern = strPattern
Set oMatch = oRegEx.Execute(str)
If oMatch.Count Then
MatchNumList = True
Else
MatchNumList = False
End If
End function
response.Write("6,1245,2122,456 " & MatchNumList("6,1245,2122,456") & "<br>")
response.Write("6,1a45,2122,456 " & MatchNumList("6,1a45,2122,456") & "<br>")
response.Write(",6,1245,2122,456 " & MatchNumList(",6,1245,2122,456") & "<br>")
response.Write("6,1245,2122,456, " & MatchNumList("6,1245,2122,456,") & "<br>")
%>