$count = () = $str =~ /PATTERN/g; # Non-overlapping mat +ches $count = () = $str =~ /(?=(PATTERN))/g; # Overlapping matches $count = 0; $str =~ /PATTERN(?{$count ++})(?!)/; # All matches
In reply to Re: number of matches
by Anonymous Monk
in thread number of matches
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |