>>319
後方参照

yagrep なら
yagrep -P "(?:(.)\1){3}" foo.txt
でいけた

普通の grep でも
grep -E "(.)\1(.)\2(.)\3" foo.txt
でいいと思う