六月婷婷综合激情-六月婷婷综合-六月婷婷在线观看-六月婷婷在线-亚洲黄色在线网站-亚洲黄色在线观看网站

明輝手游網(wǎng)中心:是一個(gè)免費(fèi)提供流行視頻軟件教程、在線學(xué)習(xí)分享的學(xué)習(xí)平臺(tái)!

完成搜索結(jié)果的關(guān)鍵詞變色標(biāo)注的程序(使用正則表達(dá)式)

[摘要]<%' 以前寫全文檢索程序的時(shí)候?qū)懙?' 原創(chuàng) by 飛鳥@dev-club.com' Email: [email protected]' ie5.5 腳本引擎 required dim patern dim found dim...

<%
' 以前寫全文檢索程序的時(shí)候?qū)懙?
' 原創(chuàng) by 飛鳥@dev-club.com
' Email: [email protected]
' ie5.5 腳本引擎 required

    dim patern
    dim found
    
    dim str
    dim result
    
    patern="(a) (b)"
    str=" A dog fall in love with a cat. Can you believe?"
    result=""    
    call getMatchText(str,result,false)
    Response.Write result

    sub getMatchText(byref str,byref result,isNeedTrunc)
        'on error resume next
        Dim regEx, Match, Matches
        dim tStr
        Set regEx = New RegExp         ' 建立正則表達(dá)式。        
        regEx.Pattern = (patern)    ' 設(shè)置模式。
        regEx.IgnoreCase = True         ' 設(shè)置是否區(qū)分字符大小寫。
        regEx.Global = True         ' 設(shè)置全局可用性。
        Set Matches = regEx.Execute(str)   ' 執(zhí)行搜索。    
        if err.number<>0 then
            response.write "錯(cuò)誤1:" & err.description
            err.clear
            exit sub
        end if
        if matches.count <>0 then
            dim startIndex            
            dim myMatchValue
            startIndex=1
            for each match in matches
                if (instr(str,match.value)>0) then
                    if instr(str,match.value)-50 >0 then
                        startIndex=instr(str,match.value)-50
                    else
                        startIndex=1
                    end if
                    myMatchValue=match.value
                    exit for
                end if
            next
            if isNeedTrunc then
                result= (mid(str,startIndex,strLength(myMatchValue)+100))
            else
                result= (str)    
            end if
            for each match in matches
                if not(instr(result,"<font color=red>" & match.value & "</font>")>0) then
                    result=replace(result,match.value,"<font color=red>" & match.value & "</font>" )
                end if
            next
            found=true
        else
            found=false
        end if    
        set regEx=nothing
    end sub
    
%>


主站蜘蛛池模板: 思思99re66在线精品免费观看 | 亚洲视频在线观 | 日本在线观看免费 | 在线亚洲+欧美+日本专区 | 在线看片欧美 | 欧美怡红院免费的视频 | 夜间视频在线观看 | 婷婷三级| 日韩一区二区三区免费视频 | 天天狠天天透天天伊人 | 四虎影院美女 | 日本在线高清 | 亚洲国产亚洲综合在线尤物 | 青草青青视频在线观看 | 天天综合网天天综合色不卡 | 四虎国产精品视频免费看 | 亚洲欧美v视色一区二区 | 青娱乐九色| 亚洲天堂欧美 | 欧美一级片网址 | 在线看亚洲| 亚洲男人在线天堂 | 亚洲成a人片在线观看播放 亚洲成a人片在线观看www | 四虎伊人| 日韩黄 | 手机看片日韩在线 | 午夜一级福利 | 欧美在线视频播放 | 日本高清视频在线观看 | 在线视频一区二区日韩国产 | 日日摸夜夜添夜夜添影院视频 | 午夜国产精品福利在线观看 | 天堂午夜| 青青青免费观看在线视频高清 | 日日噜噜噜夜夜爽爽狠狠69 | 午夜免费啪啪 | 日本天堂视频 | 色老久久精品偷偷鲁一区 | 伊人久久影视 | 日韩在线视频免费观看 | 日产国产欧美韩国在线 |