This is a regular language. A deterministic finite automaton needs only to remember the number of consecutive trailing ones, up to three, and whether a forbidden run of four has already occurred. Use states , start at , and accept in . Its transition function of a finite automaton is:
StateOn On
Reading a zero resets the trailing count unless rejection has already occurred. A fourth successive one enters the permanent rejecting state . Thus the accepted strings are exactly those with no substring , and