david.paige has asked for the wisdom of the Perl Monks concerning the following question:
The code searches for terms in a file, and changes the color if it finds them. For example, to find the (C) string, I use
\( *[Cc] *\)
which should look for an opening parenthesis, any number of spaces, one case-insensitive C, any number of spaces, and a closing parenthesis.
In windows, it correctly highlights the first three characters of "(C)opyright", but it Solaris it finds multiple "C", not just in parenthesis.
I can't figure out how Solaris is different. It only triggers on the "C", not the "(C)", making my output file much bigger than it should be. Thanks for the assistance. (substitution at paiged.fea.st)foreach $WORD in (@WORD_LIST) { $LINE =~ s/($WORD)/<font color=red><b><i>$1<\/i><\/b><\/font>/gi & +& $contains_word++; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Substitution Problem
by kennethk (Abbot) on Mar 25, 2009 at 18:37 UTC | |
by david.paige (Initiate) on Mar 25, 2009 at 19:07 UTC | |
by ikegami (Patriarch) on Mar 25, 2009 at 20:03 UTC | |
|
Re: Substitution Problem
by RoyCrowder (Monk) on Mar 25, 2009 at 18:35 UTC |