3v4l.org

run code in 500+ PHP versions simultaneously
<?php $input = <<<'TEXT' 1. Qatar 2. Qatar 3 . Cathay 4. Qatar 2 . British 3. Qantas TEXT; $output = preg_replace('/(\d+)([.\s]*)/m','$1 . ',$input); echo $output;

preferences:
88.77 ms | 1455 KiB | 5 Q