Diapositive PPT
# w - The window in which to search. Must be a text widget.
# string - The string to search for. (regexp and so on...)
# tag - Tag to apply to each instance of a matching string.
my($w, $string, $tag) = @_;
$w->tag('remove', $tag, '0.0', 'end');
(my $num_lines) = $w->index('end') =~ /(\d*)\.\d*/;
for($i = 1; $i <=$num_lines; $i++) {
my $line = $w->get("${i}.0", "${i}.1000");
next if not defined $line or $line !~ /($string)/;
my $index = index $line, $stringRegexp, $tmpoffset;
$w->tag('add', $tag, sprintf("%d.%d", $i, $offset), sprintf("%d.%d", $i, $offset+$l));
$line = substr $line, $index+$l;
if ($line=~/($string)/) { $stringRegexp=$1;