'//过滤脏话函数
Function ChkBadWords(fString,BadWords)
dim bwords
bwords = split(BadWords, "|")
for i = 0 to ubound(bwords)
fString = Replace(fString, bwords(i), string(len(bwords(i)),"*"), 1,-1,1)
next
ChkBadWords = fString
End Function
'用正则表达式突出显示字符串中查询到的单词的函数
Function BoldWord(strContent,word)
dim objRegExp
Set objRegExp=new RegExp
objRegExp.IgnoreCase =true
objRegExp.Global=True
objRegExp.Pattern="(" & word & ")"
strContent=objRegExp.Replace(strContent,"<font color=""#ff0000"">$1</font>" )
Set objRegExp=Nothing
BoldWord=strContent
End Function
本文地址:http://com.8s8s.com/it/it8026.htm