<?$text=file_get_contents("php://stdin");$RE="/\\G(.*?(?<!\\\\)(?:\\\\\\\\)*):/";var_dump(preg_split($RE, $text, 0, PREG_SPLIT_NO_EMPTY|PREG_SPLIT_DELIM_CAPTURE));?>
a\\\\:b\\:c:d\:h:g
array(5) { [0]=> string(5) "a\\\\" [1]=> string(3) "b\\" [2]=> string(1) "c" [3]=> string(4) "d\:h" [4]=> string(1) "g" }
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!