Hi, i have this piece of perl code (sorry) but it is about regular expressions and i think some of you might know the answer...
This is my code:
foreach (@SearchWords) { $temp2 =~s/$/<span class=\"select\">$<\/span>/g; }
@SearchWords is an array e.g. ("Multimedia", "ICT")
But now i want the words "multimedia" and "ict" to also be highlighted (e.g. replaced).
But when i do it like this:
foreach (@SearchWords) { $temp2 =~s/$/<span class=\"select\">$<\/span>/gi; }
then the word "ict" will be replaced with the word that is in the searchwords array (in this case "ICT") so my text gets messed up..
Any tips?
So i want to search case insensitive for words which are in an array, and replace the found word with thesame word but with some extra html (so i do not want to use the word in my array for it)