3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "tel: 012 213 123. mobil: 0303 11234 \n address: street 14"; echo preg_replace( '/tel\D*(\d+(?: \d+)*).*/is', '$1', $text );
Output for 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
012 213 123

preferences:
54.73 ms | 979 KiB | 4 Q