3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/(\d\.?)+/'; $str = '2.1.0'; preg_match($re, $str, $matches, PREG_OFFSET_CAPTURE, 0); // Print the entire match result var_dump($matches);

preferences:
54.09 ms | 402 KiB | 5 Q