3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = "The time is 1020 and the time is 1340 and 1550"; echo preg_replace('~\b\d{2}\K(?=\d{2}\b)~', ':', $data);

preferences:
31.08 ms | 404 KiB | 5 Q