正規表現道場@2ch

このエントリーをはてなブックマークに追加
76名無しさん@お腹いっぱい。
>>75 >>1のリンクぐらい見てから聞け。

#! perl

$str = '■■■■■■■■■■■■';
$str =~s/(?:■){2,}/■■/;

print $str;