您的位置:建站学院首页 >> 文章 >> asp技术 >> 正则表达式
用正则表达式突出显示字符串中查询到的单词的函数
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
Google
 
Web www.cqxw.net