in reply to Count number of occurrences of a substr
Here are two ways of counting matches:
$n++ while $str=~/this/g; $str =~ /this(?{$n++})(*F)/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Count number of occurrences of a substr
by ikegami (Patriarch) on Sep 28, 2011 at 18:53 UTC |