任意の文字が3つ以上連続したら1つに置換

文字が分かっていれば
tr/A/A/s
じゃぁ任意の文字だったら?
s/(.)1{2,}/1/g
悩んだ・・・。

Share

  • Add this entry to Hatena Bookmark

Follow Me