Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

asp highlight text

  • 20-01-2006 05:10PM
    #1
    Closed Accounts Posts: 1,200 ✭✭✭


    hi guys,

    i am using at the moment this type of regular expression to highlight a word from the search form.

    function ShowBold(theField)
    Set objRegExp= New RegExp
    objRegExp.Pattern="(" & searchparam & ")"
    objRegExp.IgnoreCase=True
    objRegExp.Global=True
    ShowBold=objRegExp.Replace(theField,"<b style=""background-color:#FFFF00; font-weight:bold;"">$1</b>")
    end function

    i would like to be able to highlight every ocurence of the world if there are more then one and the words are not beside each other.

    Ex.
    text: "i have a cd player that will play cd and also mp3"

    if i search for cd player i get the "cd player" highlight it but not the cd on its own (the one in bold)


Comments

Advertisement
Advertisement