Here are two ways of counting matches:
$n++ while $str=~/this/g; $str =~ /this(?{$n++})(*F)/;
In reply to Re: Count number of occurrences of a substr
by hbm
in thread Count number of occurrences of a substr
by Jerbear217
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |