my $str = "The quick brown fox jumps over the lazy dog"; my $count = () = $str =~ m/(\bthe\b)/ig; print $count;