A little more complex, but possibly a little more memory friendly, is:$count = () = map /y/g, /<.*?>/g;
use List::Util 'sum'; $count = sum map { my $x = () = /y/g } /<.*?>/g;
In reply to Re: Regexes: finding ALL matches (including overlap)
by bart
in thread Regexes: finding ALL matches (including overlap)
by kaif
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |