Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

asp highlight text

Options
  • 20-01-2006 5: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