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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |