! removes sequences of characters that are repeated ! three or more times, keeping "two-or-less"... : two-or-less ( seq -- seq' ) dup dup '[ dup 2 < [ 2drop t ] [ [ 1 - _ nth = ] [ 2 - _ nth = ] 2bi and not ] if ] filter-index ; IN: scratchpad "abcccccccdeefgg" two-or-less . "abccdeefgg"