最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Highlight patterns within strings

 更新時間:2007年04月04日 00:00:00   作者:  

復(fù)制代碼 代碼如下:

'Replaces pattern with highlighted replacement (using style) and preserves case  
Public Function highlight(strText, strFind)  
    Dim objRegExp, i, strHighlight  

    'Split the search terms into an array  
    Dim arrFind  
    arrFind = Split(strFind, " ")  

    'Initialize the regular expression object to perfom the search  
    Dim oMatches, sMatch  
    Set oregExp = New RegExp  

    oregExp.Global = True 'Returns all matches to the search term  
    oregExp.IgnoreCase = True 'Case insensitive  

    'Loop through the array of search terms to find matches  
    For i = 0 to UBound(arrFind)  
        oregExp.Pattern = arrFind(i) 'Sets the search pattern string  
        Set oMatches = oregExp.Execute(strText) '// performs the search   
        for each match in oMatches  
            'Build the code to be used to highlight results  
            strHighlight = "<span class=""highlight"">" & match.value & "</span>"  
        next  
        'Replace matches from the search with the above code  
        strText = oregExp.Replace(strText, strHighlight)  
     Next  

    highlight = strText  

    Set objRegExp = Nothing  
End Function

相關(guān)文章

最新評論

额济纳旗| 望城县| 沂源县| 塘沽区| 延吉市| 松阳县| 五大连池市| 满城县| 鄂托克前旗| 南丰县| 中阳县| 绵阳市| 鹰潭市| 樟树市| 南华县| 萝北县| 通化县| 皋兰县| 建阳市| 万安县| 永吉县| 万全县| 渑池县| 团风县| 朔州市| 河东区| 益阳市| 侯马市| 高密市| 安陆市| 达拉特旗| 桦甸市| 应用必备| 博客| 南皮县| 汝州市| 赫章县| 荥阳市| 专栏| 肇东市| 乌苏市|