my @count = $str =~ /\bthe\b/gi; print scalar @count, "\n";