The hard part of this problem isn't highlighting the search term, which has
been done a million times before, but rather pulling out, say, 300
characters that precede the search term and 300 characters that follow it,
so that I can show the context that a term appeared in.
"Mike" <sorrysorry.com> wrote in message
news:bhe0u8$s7k$1geraldo.cc.utexas.edu...a> "Ken Fine" <kenfineu.washington.edu> wrote in message
> news:bhdodq$23m8$1nntp6.u.washington.edu...> examine> > I'm looking to find or create an ASP script that will take a string,> return> > it for a search term, and if it finds the search term in the string,> other> > the highlighted search term along with the words that surround it. In> > words, I want the search term highlighted and shown in an excerpt of the
> > context in which it appears.
> > Any suggestions or pointers? This behavior is most often seen as part of"scanner"> > search engine. In my case, I want to use it as part of a content#FF0000"">">> > that utilizes a screen scraping component.
> Sounds like a job for replace...
> replace(string, search-string, "<span style=""background-color:you> & search-string & "</span>")
> I haven't tried it, but it seems logical. The CSS might be flaky above,> might want to verify that background-color is a valid property. :)