$count++ while $teststring =~ /test/g;
Note that there's no need for parens this time.
In reply to Re: Counting multiple matches of RegExp in single line
by gaal
in thread Counting multiple matches of RegExp in single line
by New Novice
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |