3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = <<<STRING 34.345.32.1:9032 4.3.21.234 2023 45.31.45.324:1025 STRING; preg_match_all('~(\d{1,3}(?:\.\d{1,3}){3})[: ]\K\d{4}~', $string, $matches, PREG_SET_ORDER); var_export(array_map('array_reverse', $matches));

preferences:
32.02 ms | 406 KiB | 5 Q