thanks, scain! tachyon, that is quite a lot of code to digest! but thanks also. i don't understand how it works, because i don't see $link_results anywhere, or maybe i could substitute one of the variables you wrote to $link_results? should it be $filter? here some more codes that might interest you:

a chunk from search.cgi:

# If we want to bold the search terms... if ($search_bold) { foreach $term (@search_terms) { # This reg expression will do the trick, and doesn't bold things insid +e <> tags such as # URL's. $link_results =~ s,(<[^>]+>)|(\Q$term\E),defined($1) ? + $1 : "<b>$2</b>",gie; } }

$searchbold is defined in a file called links.cfg. if it is set to 1, bolding is activated, otherwise if equal to 0. Further down in search.cgi, it says:

# Print out the HTML results. &site_html_search_results; }

That sub could be found in another file called site_html_templates:

sub site_html_search_results { # --------------------------------------------- # This routine displays the search results. # my $term = &urlencode ($in{'query'}); &html_print_headers; print &load_template ('search_results.html', { lookup => $lookup_results, antsym => $lookup_antsym, term => $term, ignored_word => $ignored_word, link_results => $link_results, category_results => $category_results, prev => $prev, next => $next, cat_hits => $cat_hits, cat => $cat_clean, link_hits => $link_hits, title_linked => $title_linked, displaying => $displaying, results_page => $results_page, csearch_results => $csearch_results, %in, %globals }); }

So, from what you suggested, I'm guessing that I may have to revise three different files. but i've no idea how to go about doing that! Sorry that i wasn't able to post codes immediately. I hope i didn't waste your effort. thanks, i really really appreciate your help!


In reply to Re: Replacement based on pattern by drewboy
in thread Replacement based on pattern by drewboy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.