<?php $re = "/(?=(1....1))/"; $str = "001110000100001100001"; preg_match_all($re, $str, $matches);print_r($matches[1]);
Standard input is empty
Array ( [0] => 100001 [1] => 100001 [2] => 100001 )
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!