in reply to RE: Search Term Highlighting
in thread Search Term Highlighting

That will find and highlight only the first match, then move on to the next line of code. It appears the OP wants to highlight *all* of the search terms in the document while preserving case.

The secret, as my fellow monks have pointed out, is using parenthesis to collect the match on the left hand side of the substitution and the special variable $1 to insert that match on the right hand side. Read more about it in perlre.

(Yes, code needs explanation of the mechanics, sometimes.)

Replies are listed 'Best First'.
RE: RE: RE: Search Term Highlighting
by librarygeek (Novice) on Jun 15, 2000 at 02:27 UTC
    Thank you for explaining how that works, I was curious but though I would try looking it up first, then ask if i couldnt figure it out myself. Now you saved me the trouble :-)