in reply to how to get the number of times a pattern matched
See perlre for more details.my $text = "my dog is green"; my $count = ( $text =~ /g/g ); # $count is 2
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re: how to get the number of times a pattern matched
by tye (Sage) on Jun 02, 2001 at 00:49 UTC | |
by danger (Priest) on Jun 02, 2001 at 01:02 UTC | |
|
Re: Re: how to get the number of times a pattern matched
by MeowChow (Vicar) on Jun 02, 2001 at 00:51 UTC |