2012-09-07 perlで指定文字列の出現回数を取得する(正規表現) perl 指定文字列の出現回数は正規表現を使って $count++ while($str =~ m/$pattern/g); もしくは $count = (() = $str =~ m/$pattern/g);