3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/1000(\d+)1500/mi'; $str = '10001212121212121500 100012121500 10001500'; preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0); // Print the entire match result $expected = []; foreach($matches as $match){ $expected[] = $match[1]; } print_r($expected); ?>

preferences:
25.01 ms | 405 KiB | 5 Q