while( $text =~ /($pattern)/g ) { my $startindex = $-[0]; my $endindex = $+[0]; my $capture = $1; my $vsoChars = $VShape->Characters; $vsoChars->{Begin} = "$startindex"; $vsoChars->{End} = "$endindex"; $vsoChars->{Text} = $capture; $vsoChars->SetProperty( 'CharProps', 1, $color ); } #### while( $text =~ /($pattern)/g ) { my $vsoChars = $VShape->Characters; $vsoChars->{Begin} = "$-[0]"; $vsoChars->{End} = "$+[0]"; $vsoChars->{Text} = $1; $vsoChars->SetProperty( 'CharProps', 1, $color ); }