in reply to Re: Matching problems
in thread Matching problems

$1 also preserves case, with the added benefit of being -w / use warnings;-friendly!

my $count = $data =~ s/\b($search)\b/$bs$1$be/gi;

    --k.