my @quotes = qw(" '); foreach my $word (@quotes) { my ($line, @found, $char, $beg, $last, $escape); my $word_len = length $word; my $next = $start; while (my $from = $t->search(-regexp, "$word", $next, $end)) { $next = "$from + $word_len chars"; my ($good, $trash) = split(/\./, $from); my $comment = $t->search( -regexp => $Comment, "$from linestart" => "$from lineend"); my $comment2 = $t->search(-regexp => $Comment2, "$from linestart" => "$from lineend"); @found = split(//, $data[$good - 1]); $char = 0; $escape = 0; foreach my $chars (@found) { $escape = 1 if ($chars eq "\\"); $last = $good.".".($char + 1) if (($chars =~ /$word/) && ($beg) && ($escape != 1)); $beg = $good.".".$char if (($chars =~ /$word/) && (!$beg) && ($escape != 1)); $escape = 0 if (($escape == 1) && ($chars =~ /$word/) || ($chars =~ /\w+/)); if (($beg) && ($last)) { unless($comment and $t->compare($comment, '<', $beg)) { unless($comment2 and $t->compare($comment2, '<', $beg)) { unhighlight_range($t, $beg, $last); mark_word($t, $beg, $last, 'String'); } } undef $beg; undef $last; } $char++; } undef $beg; undef $last; } }