in reply to Re: Regex: Matching around a word(s)
in thread Regex: Matching around a word(s)
# before if ($word =~ /$expr/) { for my $j (-5 .. 5) { $words->{$i + $j}++; } }; # after my $mwords = 5; @words{$i-$mwords..$i+$mwords} = 1 if $word =~ /$expr/; # Note: Keys created, but all but first have undef values
|
|---|