Hi all,
I have a searchfunction in perl on my website, and when visitors use this function, it will use the file linkbuild1.pl. Now, I have this code on the file linkbuild1.pl:
It replaces all searchterms (that is the $line) in the description for the same searchterm, but then bolded.
The problem is that this code doesn't seem to reconize any capitals. For example: it replaces Amsterdam for <b>amsterdam</b> in stead of <b>Amsterdam</b>. I know that it has anything to do with the i at the end of the code, but when I remove the i, it will only replace amsterdam and leaves Amsterdam untouched.
So now my question is: how can I make this line replace amsterdam for <b>amsterdam</b> and Amsterdam for <b>Amsterdam</b>.
Thanks for all you help!
I have a searchfunction in perl on my website, and when visitors use this function, it will use the file linkbuild1.pl. Now, I have this code on the file linkbuild1.pl:
Code:
$description = $linkinfo[7];
foreach $line (@searchterms) {
$description =~ s/$line/<b>$line<\/b>/ig;
}
It replaces all searchterms (that is the $line) in the description for the same searchterm, but then bolded.
The problem is that this code doesn't seem to reconize any capitals. For example: it replaces Amsterdam for <b>amsterdam</b> in stead of <b>Amsterdam</b>. I know that it has anything to do with the i at the end of the code, but when I remove the i, it will only replace amsterdam and leaves Amsterdam untouched.
So now my question is: how can I make this line replace amsterdam for <b>amsterdam</b> and Amsterdam for <b>Amsterdam</b>.
Thanks for all you help!