Cheers Casiano$ cat -n count.pl 1 use strict; 2 use List::Util qw(sum); 3 4 my @a; 5 my $string = 'ab'; 6 my $rep = sum(map { @a = /$string/g; 0+@a } <>); 7 print "$rep\n";
In reply to Re: How can I access the number of repititions in a regex?
by casiano
in thread How can I access the number of repititions in a regex?
by pat_mc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |